AsyncRoute
is a type of RouteDefinition used to route a path to an asynchronously
loaded component.
It has the following properties:
- path
is a string that uses the route matcher DSL.
- loader
is a function that returns a promise that resolves to a component.
- name
is an optional CamelCase
string representing the name of the route.
- data
is an optional property of any type representing arbitrary route metadata for the given
route. It is injectable via RouteData
.
- useAsDefault
is a boolean value. If true
, the child route will be navigated to if no child
route is specified during the navigation.
Example
import {RouteConfig, AsyncRoute} from 'angular2/router';
@RouteConfig([
new AsyncRoute({path: '/home', loader: () => Promise.resolve(MyLoadedCmp), name:
'MyLoadedCmp'})
])
class MyApp {}
- Inheritance
- Object
- AbstractRoute
- AsyncRoute
Constructors
- AsyncRoute({String name, bool useAsDefault, String path, String regex, RegexSerializer serializer, data, Future loader() })
-
const
Properties
- aux → String
-
read-only
- data → dynamic
-
read-only, inherited
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - loader → Function
-
read-only
- name → String
-
read-only, inherited
- path → String
-
read-only, inherited
- regex → String
-
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited - serializer → RegexSerializer
-
read-only, inherited
- useAsDefault → bool
-
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited