0.3.0-beta.2 • Published 7 years ago

angular-lazy v0.3.0-beta.2

Weekly downloads
14
License
BSD-3-Clause
Repository
github
Last release
7 years ago

Angular Lazy

Dependency Status devDependency Status

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".

ParamType
componentNameString

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.

ParamType
componentNameString
identifierString

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.

ParamType
pathString

License

Licensed under BSD 3-Clause.