_PAST THOUGHTS_ but still good -- sorry for the ejs =(
We should start specifying template as first parameter to Builder (making it more model/controller like)
define(['Builder','mvc!v/main'], function (Builder) {
return Builder('main');
});
This allows for proper partials within a view
<div>
<%=Builder('listItem', data);%>
</div>
However, we should have a method to account for dependencies of views, and so...
['mvc!v/listItem'], ['mvc!v/listItem2']
---------------------------
<div>
<%=Builder('listItem', data);%>
<%=Builder('listItem2', data);%>
</div>
should suffice. When the view is defined, we will do a
define(['mvc!v/listItem'], ['mvc!v/listItem2']), function () {
return myText;
});
The dashes can be of any length but we require one. Alternatively, we can consider HTML comments as the first line but it is getting onto a slippery slope.
Last notes:
- If a template does not exist,
console.error a notification and return an empty jQuery collection
- Add a method to Builder which takes a template string and renders it directly. (e.g.
Builder.render and rename the current Builder.render to Builder.template if it does what I think it does)
_PAST THOUGHTS_ but still good -- sorry for the ejs =(
We should start specifying template as first parameter to Builder (making it more model/controller like)
This allows for proper partials within a view
However, we should have a method to account for dependencies of views, and so...
should suffice. When the view is defined, we will do a
The dashes can be of any length but we require one. Alternatively, we can consider HTML comments as the first line but it is getting onto a slippery slope.
Last notes:
console.errora notification and return an empty jQuery collectionBuilder.renderand rename the currentBuilder.rendertoBuilder.templateif it does what I think it does)