add support for route state #1480
This commit is contained in:
parent
75e83ea565
commit
de07a54881
10 changed files with 367 additions and 196 deletions
|
|
@ -150,6 +150,18 @@ o.spec("Router.setPath", function() {
|
|||
|
||||
o($window.location.href).equals(env.protocol + "//" + (env.hostname === "/" ? "" : env.hostname) + slash + (prefix ? prefix + "/" : "") + "test")
|
||||
|
||||
done()
|
||||
})
|
||||
})
|
||||
o("state works", function(done) {
|
||||
$window.location.href = prefix + "/test"
|
||||
router.defineRoutes({"/test": {data: 1}, "/other": {data: 2}}, onRouteChange, onFail)
|
||||
|
||||
callAsync(function() {
|
||||
router.setPath("/other", null, {state: {a: 1}})
|
||||
|
||||
o($window.history.state).deepEquals({a: 1})
|
||||
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue