javascript - Display the value of selected menu item on a button angular -


i stuck @ issue have list of menu item

<md-menu-item ng-value="menuitem.value" ng-repeat="menuitem in filtermenu.menuitems" ng-click="activefilterctrl.selectedfilter(menuitem)" translate>     <md-button>         {{ menuitem.name }}     </md-button> </md-menu-item> 

following code want display value of selected menu item on button or on label should displayed after selection of menu item. please me resolve issue

in code call selectedfilter(menuitem) function. can add in function:

$scope.selectedfilter = function(menuitem){ // code here $scope.mylabel = menuitem.name; } 

and in html:

<md-button>     {{mylabel}} </md-button> 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -