You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.
When you have a view like views/subdirectory/new.js and a template like templates/subdirectory/new.ejs, the template isn't detected by the view. But when you have a view like views/no_subdirectory_new.js and a template like templates/no_subdirectory_new.ejs, the template is detected just fine.
Let me know if this bug isn't related to generator-backbone. I wasn't sure which project this bug is related to.
/*global define*/define(['jquery','underscore','backbone','templates','linkModel'],function($,_,Backbone,JST,Link){'use strict';varLinksNewView=Backbone.View.extend({/////////////////////// THIS LINE //////////////////template: JST['app/scripts/templates/link/new.ejs'],// I have the template in templates/link/new.ejs///////////////////////////////////////////////////////////// tagName: 'div',id: '',className: '',el: '#main',events: {},initialize: function(){this.model=newLink();this.listenTo(this.model,'change',this.render);this.render();},render: function(){// this.$el.html(this.template(this.model.toJSON()));this.$el.html(this.template(this.model));}});returnLinksNewView;});
This doesn't work. When I try adding debugger; in the initialize function, and check for this.template, I get undefined.
However, not using subdirectory will work.
/*global define*/define(['jquery','underscore','backbone','templates','linkModel'],function($,_,Backbone,JST,Link){'use strict';varLinksNewView=Backbone.View.extend({////// THIS LINE ////template: JST['app/scripts/templates/link_new.ejs'],///////tagName: 'div',id: '',className: '',el: '#main',events: {},initialize: function(){this.model=newLink();this.model.url='google.com';this.listenTo(this.model,'change',this.render);this.render();},render: function(){// this.$el.html(this.template(this.model.toJSON()));this.$el.html(this.template(this.model));}});returnLinksNewView;});
When I check this.template in the initialize function, it returns the function that will be used to get the content of the template.
Any idea what the problem might be? If this isn't a bug for generator-backbone, which other repository should I file this bug? Thank you.
The text was updated successfully, but these errors were encountered:
tldr
When you have a view like
views/subdirectory/new.js
and a template liketemplates/subdirectory/new.ejs
, the template isn't detected by the view. But when you have a view likeviews/no_subdirectory_new.js
and a template liketemplates/no_subdirectory_new.ejs
, the template is detected just fine.Let me know if this bug isn't related to
generator-backbone
. I wasn't sure which project this bug is related to.This doesn't work. When I try adding
debugger;
in the initialize function, and check forthis.template
, I getundefined
.However, not using subdirectory will work.
When I check
this.template
in theinitialize
function, it returns the function that will be used to get the content of the template.Any idea what the problem might be? If this isn't a bug for
generator-backbone
, which other repository should I file this bug? Thank you.The text was updated successfully, but these errors were encountered: