Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHASES, happen each time web page is loaded in the browser.
- 1. Bootsrap.
- WHEN: JS lib is loaded.
- - Angular inits own components ;
- - Module initialization in ng-app;
- - When module is loaded and any injected deps are available;
- 2. Compilation
- Static DOM is loaded in the browser and replaced by dynamic DOM(Anglar VIEW)
- TWO PARTS: 1. Traversing static DOM directives linking
- 2. The directives are combined with a scope to produce the dynamic view
- 3. Runtime
- Exists until user reloads th page. Any changes in the scope are reflected in
- the view.
- MODULE API:
- MODULE - container for different parts of your app(ctrls, services, filters,
- directives, etc);
- A module is a collection of configuration and run blocks which get applied
- to the application during the bootstrap process.
- LOADINDG
- config blocks - Use this method to register work which needs to
- be performed on module loading.
- run blocks - Use this method to register work which should be performed
- when the injector is done loading all modules.
- SERVICES TYPES:
- !singletones
- - CONSTANT: app.constant('const', {})
- - VALUE: mutable, app.value('const', {})
- - FACTORY: app.factory('foo', function()); Может вернуть любой тип данных,
- нужно лишь вернуть чо-либо.
- - SERVICE, app.service('foo', Constructor)
- - PROVIDER, app.provider('foo', function)
- функция должна вернуть объект с $get. Провайдер ожидает функцию $get,
- которая будет тем, что мы внедряем в другие части нашего приложения.
- Поэтому, когда мы внедряем foo в контроллер, то внедряется функция
- $get.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement