mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-05 17:01:19 +08:00
9486590e1be7282bb0e87586a35ca0bee6c64ee0
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
AngularJS
- Web site: http://angularjs.org
- Tutorial: http://docs.angularjs.org/#!/tutorial
- API Docs: http://docs.angularjs.org
- Developer Guide: http://docs.angularjs.org/#!/guide
Compiling
rake compile
Running Tests
./server.sh # start the server
open http://localhost:9876/capture # capture browser
./test.sh # run all unit tests
Languages
JavaScript
98.8%
HTML
0.6%
Shell
0.4%
PHP
0.1%