mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-26 22:53:58 +00:00
temparary backaward compatibility patch for Controller.init
- feedback relies on *Controller.init to be called when a Controller is being created. this with previous angular refactoring this is not happening in angular any more. To make it easier for feedback to transition, this change makes $become call controller's init method if present. - call to Controller.init from $route.updateRoute was removed. this was left there by accident during the previous refactoring.
This commit is contained in:
parent
3bd4abba6b
commit
7e47a2d016
2 changed files with 5 additions and 1 deletions
|
|
@ -233,6 +233,11 @@ function createScope(parent, services, existing) {
|
||||||
behavior[name] = bind(instance, fn);
|
behavior[name] = bind(instance, fn);
|
||||||
});
|
});
|
||||||
(Class || noop).call(instance);
|
(Class || noop).call(instance);
|
||||||
|
|
||||||
|
//TODO: backwards compatibility hack, remove when Feedback's init methods are removed
|
||||||
|
if (behavior.hasOwnProperty('init')) {
|
||||||
|
behavior.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,6 @@ angularService('$route', function(location){
|
||||||
angular.foreach(onChange, parentScope.$tryEval);
|
angular.foreach(onChange, parentScope.$tryEval);
|
||||||
if (childScope) {
|
if (childScope) {
|
||||||
childScope.$become($route.current.controller);
|
childScope.$become($route.current.controller);
|
||||||
parentScope.$tryEval(childScope.init);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$watch(function(){return dirty + location.hash;}, updateRoute);
|
this.$watch(function(){return dirty + location.hash;}, updateRoute);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue