mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
rename Template to TemplateView, as it is a view now.
This commit is contained in:
parent
2008cf74f1
commit
37c602f7d2
@ -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 New Issue
Block a user