0.1.0 • Published 8 years ago

angular-jsuri v0.1.0

Weekly downloads
3
License
-
Repository
-
Last release
8 years ago

angular-jsuri

Angular dependency injection for jsUri.

Installation

Install this service with bower:

bower install angular-jsuri

Angular and jsUri must be loaded prior to angular-jsuri.

Usage

var module = angular.module('app', ['angular-jsuri']);

module.controller('HomeController', [
  '$scope',
  'Uri',
  function($scope, Uri) {
    $scope.uri = new Uri('http://user:pass@www.test.com:81/index.html?q=books#fragment');
    $scope.uriParts = {
      protocol: uri.protocol(),    // http
      userInfo: uri.userInfo(),    // user:pass
      host: uri.host(),            // www.test.com
      port: uri.port(),            // 81
      path: uri.path(),            // /index.html
      query: uri.query(),          // q=books
      anchor: uri.anchor()         // fragment
    }
]);

License

© Dan Jarvis 2015, MIT