ng-click无法正常工作

时间:2015-07-17 09:56:21

标签: javascript html angularjs

对于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>

我的控制器工作正常

            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 ;
            };

请你帮忙,我想在点击时改变$ scope.label的价值

0 个答案:

没有答案