angular-lazy
v0.3.0-beta.2
Published
Utilities for projects based on the [Angular Lazy Generator](https://github.com/matoilic/generator-angular-lazy)
Downloads
2
Readme
Angular Lazy
Utilities for projects based on the Angular Lazy Generator.
Routing
The Angular Lazy module adds a state factory to the future states provider. The factory then takes care of loading your states of type load
defined in states.json at runtime.
Component Loader Service
The componentLoader
service allows us to load components manually in our code.
API
componentLoader
componentLoaderService.loadComponent(componentName) ⇒ Promise
Loads a component with the given name. It will automatically look for the component in the components folder.
E.g. if you pass popup
it will try to load the component from "components/popup/index".
| Param | Type | | --- | --- | | componentName | String |
componentLoaderService.resolve(componentName, identifier) ⇒ Promise
Resolves an Angular injectable, e.g. service or constant, from the given component. If ensures that the component is loaded before trying to resolve the injectable.
| Param | Type | | --- | --- | | componentName | String | | identifier | String |
System Service
The system
service is a small wrapper around System
so that import
calls can be mocked in tests if needed.
API
system
systemService.import(path) ⇒ Promise
Imports a component from the given path, relative to the baseURL configured in SystemJS.
| Param | Type | | --- | --- | | path | String |
License
Licensed under BSD 3-Clause.