Davey
Davey

Reputation: 1093

Why is this binding not working on angular js

I have a controller setup like so:

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

  $scope.updateThing = function() {
    $scope.thing = true;
  };
...

in the view I have:

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

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

My other bindings work such as input filters and what not. So, it tells me there is something wrong with this particular setup...

Upvotes: 0

Views: 49

Answers (2)

apohl
apohl

Reputation: 1923

Change

ng-hide="{{thing}}"

to this:

ng-hide="thing"

Upvotes: 2

Nikola Yovchev
Nikola Yovchev

Reputation: 10206

Should be ng-hide="thing", afaik

Upvotes: 6

Related Questions