JSPM

  • Created
  • Published
  • Downloads 867
  • Score
    100M100P100Q108199F

Pushstate for can-route

Package Exports

  • can-route-pushstate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (can-route-pushstate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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