Gathering detailed insights and metrics for angular-state-loadable
Gathering detailed insights and metrics for angular-state-loadable
Gathering detailed insights and metrics for angular-state-loadable
Gathering detailed insights and metrics for angular-state-loadable
npm install angular-state-loadable
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
17 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Aug 31, 2015
Latest Version
3.0.7
Package Id
angular-state-loadable@3.0.7
Size
15.75 kB
NPM Version
2.11.2
Node Version
0.12.6
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
24
A lightweight and flexible AngularJS lazy loading scheme.
StateLoadable is a modular component designed to be used with StateRouter, an AngularJS state-based router.
To install in your project, install from npm (remember you'll also need to install angular-state-router since it is a dependency)
npm install angular-state-loadable --save
Include the state-loadable.min.js
script tag in your .html
:
<html ng-app="myApp">
<head>
<script src="/node_modules/angular/angular.min.js"></script>
<script src="/node_modules/angular-state-router/dist/state-router.min.js"></script>
<script src="/node_modules/angular-state-loadable/dist/state-loadable.min.js"></script>
<script src="/js/app.js"></script>
</head>
<body>
...
</body>
</html>
In app.js
add angular-state-router
and angular-state-loadable
as a dependency when your application module is instantiated.
var myApp = angular.module('myApp', ['angular-state-router', 'angular-state-loadable']);
During the configuration of StateRouter utilize the parameter load
to associate a script file to lazy load. Loadables will only load once, that is, the first time that they are needed.
myApp
.config(function($stateProvider) {
$stateProvider
.state('search', {
url: '/search',
// An Array of files or a single file name String
load: ['components/search.js']
});
});
Where components.search.js
is the following file:
myApp
.controller('SearchController', function() {
// ...
});
StateLoadable is meant to be flexible and therefore does not impose any scheme for registering angular components (directives, controllers, filters, services, providers, and/or ... etc.)
We suggest using the scheme in the example code for late registration of these components.
Remember that $stateProvider
is different from $state
.
Events are broadcast on the $rootScope
.
This event is emitted when a loadable object starts loading.
This event is emitted when a loadable object progresses loading. This event must occur once before 'end'
is emitted.
This event is emitted when a loadable object completes loading.
This event is emitted when an error occurred during loading of a loadable.
Copyright (c) 2015 Henry Tseng
Released under the MIT license. See LICENSE for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More