angularjs - How to access a function defined in a ui-router state controller -


i have angular ui-router state controller follows.

 $stateprovider.state('contacts', {   template: '<h1>{{title}}</h1>',   controller: function($scope){     $scope.title="mytitle";     $scope.myfunction= function(){          //do     };   },   data:{      list:[             {               item:"item1",               callback:{{myfunction}}             }           ]   } }) 

as shown in code above, state controller has function attached scope called "myfunction". have directive accesses state. in directive, want call myfunction callback when item1 clicked(i have button corresponding item1 mentioned in data section). please let me know how can call myfunction method directive.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -