diff options
| author | Vojta Jina | 2012-02-19 12:31:11 -0800 |
|---|---|---|
| committer | Vojta Jina | 2012-02-28 17:46:58 -0800 |
| commit | 9486590e1be7282bb0e87586a35ca0bee6c64ee0 (patch) | |
| tree | bb7a808e077f134ddc26b84e35a406e62dbf117d /src/AngularPublic.js | |
| parent | e31d1c287d972d633bdaf9c385d3012192f64918 (diff) | |
| download | angular.js-9486590e1be7282bb0e87586a35ca0bee6c64ee0.tar.bz2 | |
refactor(ng:view) Make $route scope agnostic, add $contentLoaded event
Problems:
- controller was instantiated immediately on $afterRouteChange (even if no content), that's
different compare to ng:controller, which instantiates controllers after compiling
- route listened on current scope ($afterRouteChange), so if you were listening on $rootScope
($afterRouteChange), you get called first and current.scope === undefined, which is flaky
- route handles scope destroying, but scope is created by ng:view
- route fires after/before route change even if there is no route (when no otherwise specified)
Solution:
- route has no idea about scope, whole scope business moved to ng:view (creating/destroying)
- scope is created (and controller instantiated) AFTER compiling the content
- that means on $afterRouteChange - there is no scope yet (current.scope === undefined)
- added $contentLoaded event fired by ng:view, after linking the content
Diffstat (limited to 'src/AngularPublic.js')
0 files changed, 0 insertions, 0 deletions
