Implemented templates feature

This commit is contained in:
Borys Levytskyi
2015-04-04 15:48:56 +03:00
parent 2731f11070
commit a3ca46174b
4 changed files with 57 additions and 18 deletions

View File

@@ -19,6 +19,10 @@
controllerDi.register(name, reg);
};
app.run(function(){
attachControllers(app.rootViewElement, app.di);
});
function addControllerMixin(ctrl) {
ctrl.attachView = function(viewElement) {
@@ -39,10 +43,6 @@
};
}
app.run(function(){
attachControllers(app.rootViewElement, app.di);
});
function attachControllers(rootViewElement) {
var elements = rootViewElement.querySelectorAll('[data-controller]'),
i = 0, l = elements.length,
@@ -78,9 +78,4 @@
}
}
function isController(obj) {
return obj.componentType == 'controller';
}
})(window.app, window.should, window.Container);