Instruction is a tree of ComponentInstructions with all the information needed to transition each component in the app to a given route, including all auxiliary routes.
Instructions can be created using Router#generate
, and can be used to
perform route changes with Router#navigateByInstruction
.
Example
import 'package:angular2/angular2.dart'; import 'package:angular2/platform/browser.dart'; import 'package:angular2/router.dart';
@Component(directives: ROUTER_DIRECTIVES
)
@RouteConfig(const
{...},
)
class AppCmp {
AppCmp(Router router) {
var instruction = router.generate(['/MyRoute']);
router.navigateByInstruction(instruction);
} }
bootstrap(AppCmp, ROUTER_PROVIDERS);
Constructors
- Instruction(ComponentInstruction component, Instruction child, Map<String, Instruction> auxInstruction)
Properties
- auxInstruction → Map<String, Instruction>
-
read / write
- child → Instruction
-
read / write
- component → ComponentInstruction
-
read / write
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - path → String
-
If the final URL for the instruction is ``.
read-only - rootUrl → String
-
Converts the instruction into a URL string.
read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited - specificity → String
-
read-only
- urlParams → List<String>
-
read-only
- urlPath → String
-
read-only
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
replaceChild(
Instruction child) → Instruction -
Returns a new instruction that shares the state of the existing instruction, but with the given child Instruction replacing the existing child.
-
resolveComponent(
) → Future<ComponentInstruction> -
toLinkUrl(
) → String -
toString(
) → String -
Returns a string representation of this object.
inherited -
toUrlPath(
) → String -
toUrlQuery(
) → String