angular-state-router
Version:
An AngularJS state-based router designed for flexibility and ease of use.
39 lines (25 loc) • 1.01 kB
JavaScript
;
/* global angular:false */
// CommonJS
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
module.exports = 'angular-state-router';
}
// Instantiate module
angular.module('angular-state-router', [])
.provider('$state', require('./services/state-router'))
.factory('$urlManager', require('./services/url-manager'))
.factory('$resolution', require('./services/resolution'))
.factory('$enact', require('./services/enact'))
.factory('$queueHandler', require('./services/queue-handler'))
.run(['$rootScope', '$state', '$urlManager', '$resolution', '$enact', function($rootScope, $state, $urlManager, $resolution, $enact) {
// Update location changes
$rootScope.$on('$locationChangeSuccess', function() {
$urlManager.location(arguments);
});
$urlManager.$ready();
$resolution.$ready();
$enact.$ready();
// Initialize
$state.$ready();
}])
.directive('sref', require('./directives/sref'));