javascript - ng-click not working correctly -


for html

                    <button ng-click="clicked();" class="btn btn-sm btn-success" id="itemselection"     ui-sref="resourcedefault.clicked({name:item.name,energyid:item.energyid, energychain:item.energychain,resourceid:item.resourceid,facilityid:item.facilityid})">                         {{item.name}}                     </button> 

and controller works fine

            resourcesapp.controller('detailscontroller', ['$scope', '$stateparams', function ($scope, $stateparams) {             $scope.label = $stateparams.name;               $scope.show = true;              $scope.clicked = function ($stateparams) {                 $scope.show = !show                 $scope.label = $stateparams.name;                 return ;             }; 

can please ,i want chhange value of $scope.label when clicked


Comments