San Jay Falcon
San Jay Falcon

Reputation: 1013

implementation of ngShow

Had this working earlier, now it doesnt respond accordingly.

In my html:

<div ng-click="setFalse();" ng-show"emptyspotslist">No results</div>

Controller:

$scope.setFalse = function () {
$scope.emptyspotslist = !$scope.emptyspotslist;
console.log($scope.emptyspotslist);
}

Default value of $scope.emptyspotslist = true. The DIV doesnt hide, after clicking. Function gets called though. Probably something really simple i'm overlooking.

Upvotes: 1

Views: 255

Answers (2)

Apoorv Parijat
Apoorv Parijat

Reputation: 871

You should have a = after ng-show attribute

Old

<div ng-click="setFalse();" ng-show"emptyspotslist">No results</div>

New

<div ng-click="setFalse();" ng-show="emptyspotslist">No results</div>

Upvotes: 2

Langdon
Langdon

Reputation: 20073

Your HTML is malformed...

ng-show="emptyspotslist"

You're missing an equals =.

Upvotes: 1

Related Questions