![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
angular-ui-router.statehelper
Advanced tools
A helper module for AngularUI Router, which allows you to define your states as an object tree.
A helper module for AngularUI Router, which allows you to define your states as an object tree.
bower install angular-ui-router.stateHelper
or npm install angular-ui-router.statehelper
stateHelper.min.js
.ui.router.stateHelper
in your app module.// NOTE: when using child states with views you should make sure that its parent has a template containing a `ui-view` directive.
angular.module('myApp', [ 'ui.router', 'ui.router.stateHelper' ])
.config(function(stateHelperProvider){
stateHelperProvider
.state({
name: 'root',
templateUrl: 'root.html',
children: [
{
name: 'contacts',
template: '<ui-view />',
children: [
{
name: 'list',
templateUrl: 'contacts.list.html'
}
]
},
{
name: 'products',
templateUrl: 'products.html',
children: [
{
name: 'list',
templateUrl: 'products.list.html'
}
]
}
]
})
.state({
name: 'rootSibling',
templateUrl: 'rootSibling.html'
});
});
By default, all state names are converted to use ui-router's dot notation (e.g. parentStateName.childStateName
).
This can be disabled by calling .state()
with options options.keepOriginalNames = true
.
For example:
angular.module('myApp', ['ui.router', 'ui.router.stateHelper'])
.config(function(stateHelperProvider){
stateHelperProvider.state({
name: 'root',
templateUrl: 'root.html',
children: [
{
name: 'contacts',
templateUrl: 'contacts.html'
}
]
}, { keepOriginalNames: true });
});
Child states may optionally receive a reference to the name of the previous state (if available) and the next state (if available) in order to facilitate sequential state traversal as in the case of building wizards or multi-part forms. Enable this by setting options.siblingTraversal = true
.
Example:
angular.module('myApp', ['ui.router', 'ui.router.stateHelper'])
.config(function(stateHelperProvider){
stateHelperProvider.state({
name: 'resume',
children: [
{
name: 'contactInfo',
},
{
name: 'experience',
},
{
name: 'education',
}
]
}, { siblingTraversal: true });
});
console.log($state.get('resume.contactInfo').previousSibling) // undefined
console.log($state.get('resume.contactInfo').nextSibling) // 'resume.experience'
console.log($state.get('resume.experience').previousSibling) // 'resume.contactInfo'
console.log($state.get('resume.experience').nextSibling) // 'resume.education'
console.log($state.get('resume.education').previousSibling) // 'resume.experience'
console.log($state.get('resume.education').nextSibling) // undefined
Before 1.2.0 .setNestedState
was used instead of .state
. In 1.2.0 setNestedState
was deprecated in favour of .state
, and chaining was added. This makes it easier to switch between $stateProvider
and stateHelperProvider
.
FAQs
A helper module for AngularUI Router, which allows you to define your states as an object tree.
The npm package angular-ui-router.statehelper receives a total of 213 weekly downloads. As such, angular-ui-router.statehelper popularity was classified as not popular.
We found that angular-ui-router.statehelper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.