mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-20 11:42:39 +01:00
Introduced core.
This commit is contained in:
@@ -1,22 +1,20 @@
|
||||
(function(app, should, Container) {
|
||||
(function(app, core) {
|
||||
|
||||
var controllerDi = app.di; // TODO: Compbine
|
||||
var should = core.should;
|
||||
|
||||
app.controller = function(name, instOrFactory) {
|
||||
|
||||
should.beString(name, "name");
|
||||
|
||||
if(instOrFactory == null) {
|
||||
return controllerDi.resolve(name);
|
||||
return this.get(name);
|
||||
}
|
||||
|
||||
var reg = new Container.Registration(instOrFactory);
|
||||
var reg = new core.Container.Registration(instOrFactory);
|
||||
|
||||
reg.onFirstTimeResolve = function (inst) {
|
||||
addControllerMixin(inst);
|
||||
};
|
||||
|
||||
controllerDi.register(name, reg);
|
||||
this.set(name, reg);
|
||||
};
|
||||
|
||||
app.run(function(){
|
||||
@@ -78,4 +76,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
})(window.app, window.should, window.Container);
|
||||
})(window.app, window.core);
|
||||
|
||||
Reference in New Issue
Block a user