Skip to content

nowk/js-nglocation-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

js-nglocation-provider

Browserify David DM

An ng-service wrapping pushState and location.href.

Install

npm install js-nglocation-provider --save-dev

Usage

app.controller("UsersCtrl", ["locationProvider", "User" function(location, User) {
  $scope.save = function() {
    User.save({}, {}).$promise
      .then(function(data) {
        location.path("/users/" + data._id)
          .title("User : " + data.name)
          .push();
      })
      .catch(function(err) {
        // handle
      });
  };
}]);

License

MIT

About

An angular service wrapping `pushState` and `location.href`

Resources

Stars

Watchers

Forks

Packages

No packages published