Redirect is a type of RouteDefinition used to route a path to a canonical route.

It has the following properties: - path is a string that uses the route matcher DSL. - redirectTo is an array representing the link DSL.

Note that redirects do not affect how links are generated. For that, see the useAsDefault option.

Example

import {RouteConfig, Route, Redirect} from 'angular2/router';
 
@RouteConfig([
  new Redirect({path: '/', redirectTo: ['/Home'] }),
  new Route({path: '/home', component: HomeCmp, name: 'Home'})
])
class MyApp {}
Inheritance

Constructors

Redirect({String name, bool useAsDefault, String path, String regex, RegexSerializer serializer, data, List redirectTo })

const

Properties

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
redirectTo → List

read-only
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