ui-state-loader
Angular UI Router state definition loader
Extract and Exports state definition from source
Installation
$ npm install ui-state-loader --save
Usage
some-state.js
const angular = require('angular');
angular.module('myApp', [
require('angular-ui-router')
]).config(['$stateProvider', function($stateProvider) {
$stateProvider.state('foo', {
url: '/foo',
controller: 'FooCtrl',
template: require('./foo.jade'),
abstract: true
});
$stateProvider.state('foo.bar', {
url: '/bar',
controller: 'BarCtrl',
template: '<p>Page bar</p>'
});
}]).config(['$stateProvider', function($stateProvider) {
$stateProvider.state('foo.baz', {
url: '/baz',
controller: 'BazCtrl',
template: '<p>Page baz</p>'
});
}]);
const states = require('ui-state!./some-state');
License
MIT License
See full license on mooyoul.mit-license.org