Route
is a type of RouteDefinition used to route a path to a component.
It has the following properties:
- path
is a string that uses the route matcher DSL.
- component
a component type.
- 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, Route} from 'angular2/router';
@RouteConfig([
new Route({path: '/home', component: HomeCmp, name: 'HomeCmp' })
])
class MyApp {}
- Inheritance
- Object
- AbstractRoute
- Route
Constructors
- Route({String name, bool useAsDefault, String path, String regex, RegexSerializer serializer, data, component })
-
const
Properties
- aux → String
-
read-only
- component → dynamic
-
read-only
- data → dynamic
-
read-only, inherited
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - 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