forked from mystiq/hydrogen-web
rename Template to TemplateView, as it is a view now.
This commit is contained in:
parent
2008cf74f1
commit
37c602f7d2
1 changed files with 5 additions and 3 deletions
|
@ -22,7 +22,7 @@ function objHasFns(obj) {
|
|||
missing:
|
||||
- create views
|
||||
*/
|
||||
export class Template {
|
||||
export class TemplateView {
|
||||
constructor(value, render = undefined) {
|
||||
this._value = value;
|
||||
this._render = render;
|
||||
|
@ -257,7 +257,7 @@ export class Template {
|
|||
|
||||
// sugar
|
||||
createTemplate(render) {
|
||||
return vm => new Template(vm, render);
|
||||
return vm => new TemplateView(vm, render);
|
||||
}
|
||||
|
||||
// creates a conditional subtemplate
|
||||
|
@ -282,7 +282,9 @@ export class Template {
|
|||
}
|
||||
|
||||
for (const tag of TAG_NAMES) {
|
||||
Template.prototype[tag] = function(attributes, children) {
|
||||
TemplateView.prototype[tag] = function(attributes, children) {
|
||||
return this.el(tag, attributes, children);
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: should we an instance of something else than the view itself into the render method? That way you can't call template functions outside of the render method.
|
Loading…
Reference in a new issue