-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
In the documentation, it states that you can navigate programmatically using the .navigate method on a reference to the router component instance. Unfortunately, the source code requires a second argument to be passed in the form a function yet it doesn't state this anywhere. If you don't pass any additional arguments, the setPath method breaks as it expects a "navigation" argument to be an object:
Environment.prototype.navigate = function navigate(path, navigation, cb) {
if (typeof navigation === 'function' && cb === undefined) {
cb = navigation;
navigation = {};
}
return this.setPath(path, navigation, cb);
}
Environment.prototype.setPath = function(path, navigation, cb) {
if (!navigation.isPopState) {
if (navigation.replace) {
this.replaceState(path, navigation);
} else {
this.pushState(path, navigation);
}
}
this.path = path;
this.notify(navigation, cb);
}
Metadata
Metadata
Assignees
Labels
No labels