angularjs - Pass resolved objects into controllers defined by a string in angular-ui router -
I have a set of objects that can be solved using: solve
I have a Controller is also I define it by giving it a string name, but I have to pass it in the solution items
I know that this can be done:
Resolution: {title: 'my contacts'}, administrator: work ($ radius, title) {$ scope. Title = 'my contact'; }}
But I need to:
Resolution: {title: 'my contact'}, controller: 'result editor'} << / P>
How can I pass my controller in the 'title' in this sense? "Post-text" itemprop = "text">
Try it out ( it should work ): // state configuration ... {Resolve: {Title: function () {Return 'My Contacts'; }}, Controller: 'MyCtrl'} // Controller app.controller ('MyCtrl', function ($ radius, title) {$ scope.title = title; console.log ($ scope.title); // - & gt; ; 'My contact'});
Comments
Post a Comment