angular-lazy

0.3.0-beta.2 • Public • Published

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

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.

Readme

Keywords

none

Package Sidebar

Install

npm i angular-lazy

Weekly Downloads

2

Version

0.3.0-beta.2

License

BSD-3-Clause

Last publish

Collaborators

  • matoilic