2014-02-07 72 views
0

我有一個控制器設置像這樣:這是爲什麼約束力不工作的角度JS

<button ng-click='updateThing()'>CLICK THIS TO HIDE THE P</button> 

<p ng-hide="{{thing}}">hide this when button clicked</p> 

我的其他綁定工作,如輸入濾波器和什麼:

.controller('ProductsCtrl', function ProductsController($scope, ProductRes, $state, $http) { 

    $scope.updateThing = function() { 
    $scope.thing = true; 
    }; 
... 
在視圖中我有

不。所以,它告訴我有什麼不對這個特別設置...

回答

6

應該是ng-hide="thing",據我所知

2

變化

ng-hide="{{thing}}" 

這樣:

ng-hide="thing"