diff options
| author | Igor Minar | 2010-10-12 05:31:32 +0800 |
|---|---|---|
| committer | Misko Hevery | 2010-10-13 04:37:45 +0800 |
| commit | 7e47a2d016676f37287203f26689cce1ee1eaa0c (patch) | |
| tree | edd2e2d9e9e00e451dd6a06345b1717d1e4ab1fd | |
| parent | 3bd4abba6bb4c1f8312e25a3d87fbfefcd218e0d (diff) | |
| download | angular.js-7e47a2d016676f37287203f26689cce1ee1eaa0c.tar.bz2 | |
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.
| -rw-r--r-- | src/Scope.js | 5 | ||||
| -rw-r--r-- | src/services.js | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/Scope.js b/src/Scope.js index 53228a0d..3aaff361 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -233,6 +233,11 @@ function createScope(parent, services, existing) { behavior[name] = bind(instance, fn); }); (Class || noop).call(instance); + + //TODO: backwards compatibility hack, remove when Feedback's init methods are removed + if (behavior.hasOwnProperty('init')) { + behavior.init(); + } } }); diff --git a/src/services.js b/src/services.js index 9bf3d1ed..41755962 100644 --- a/src/services.js +++ b/src/services.js @@ -253,7 +253,6 @@ angularService('$route', function(location){ angular.foreach(onChange, parentScope.$tryEval); if (childScope) { childScope.$become($route.current.controller); - parentScope.$tryEval(childScope.init); } } this.$watch(function(){return dirty + location.hash;}, updateRoute); |
