Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ui-state-loader

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ui-state-loader

Angular UI Router state definition loader

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

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');
/*
  Equal as
  const states = [{
    name: 'foo',
    url: '/foo',
    controller: 'FooCtrl',
    // template: require('./foo.jade'), // @note ignores CallExpression
    abstract: true
  }, {
    name: 'foo.bar',
    url: '/bar',
    controller: 'BarCtrl',
    template: '<p>Page bar</p>'
  }, {
    name: 'foo.baz',
    url: '/baz',
    controller: 'BazCtrl',
    template: '<p>Page baz</p>'
  }];
 */

License

MIT License

See full license on mooyoul.mit-license.org

Keywords

FAQs

Package last updated on 28 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc