Pushstate for can-route
JavaScript HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.editorconfig
.gitignore
.jshintrc
.npmignore
.travis.yml
build.js
can-route-pushstate.js
can-route-pushstate.md
can-route-pushstate_test.js
package.json
readme.md

readme.md

can-route-pushstate

Build Status

Pushstate for can-route

API

{Object}

Changes can-route to use pushstate to change the window's pathname instead of the hash.

var route = require("can-route-pushstate");

route(":page", { page: "home" });
route.ready();

route.attr("page", "user");

location.pathname; // -> "/user"

Object

  • The {Object}: pushstate object comprises several properties that configure the behavior of [can-route] to work with history.pushstate.

Contributing

Making a Build

To make a build of the distributables into dist/ in the cloned repository run

npm install
node build

Running the tests

Tests can run in the browser by opening a webserver and visiting the test.html page. Automated tests that run the tests from the command line in Firefox can be run with

npm test