Immutable map of parameters for the given route based on the url matcher and optional parameters for that route.
You can inject RouteParams into the constructor of a component to use it.
Example
import 'package:angular2/angular2.dart'; import 'package:angular2/platform/browser.dart'; import 'package:angular2/router.dart';
@Component(directives: ROUTER_DIRECTIVES
)
@RouteConfig(const
{'path': '/user/:id', 'component': UserCmp, 'name': 'UserCmp'},
)
class AppCmp {}
@Component( template: 'user: {{id}}' ) class UserCmp { String id; UserCmp(RouteParams params) {
id = params.get('id');
} }
bootstrap(AppCmp, ROUTER_PROVIDERS);
Constructors
- RouteParams(Map<String, String> params)
Properties
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - params → Map<String, String>
-
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
get(
String param) → String -
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