Skip to content

myplanet/angular-ui-sref-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-ui-sref-state

Resolves the target state object of a ui-sref attribute in applications using angular-ui-router.

Usage

For example, if you're using angular-ui-router and you have an element directive that needs to resolve the target state of the ui-sref attribute:

<my-directive ui-sref=".foo.bar">Foo Bar</my-directive>
angular
    .module('myModule', [ 'ui.router', 'mp.uiSrefState' ])
    .directive('myDirective', [ '$uiSrefState', function ($uiSrefState) {
        restrict: 'E',
        
        link: function (state, element) {
            var targetState = $uiSrefState.getTargetStateOfElement(element);
            
            // do something with the targetState object
        }
    });

About

Resolves the target state object of a ui-sref

Resources

Stars

Watchers

Forks

Packages

No packages published