Reputation: 1756
Here is my code
<div ng-init="$scope.bot_assistance='false'">
<label for="switch">Bot Assistance:
<input type="checkbox" id="switch" ng-model="$scope.bot_assistance">
</label><br/>
<p>Value:-{{ $scope.bot_assistance }}</p>
<div ng-hide="$scope.bot_assistance">Bot Assist Disabled</div>
</div>
After my page loads I can see the value of $scope.bot_assistance='false'
but why is my ng-hide
evaluating to be true
and not showing up on the page.
Also it shows up div block after I check and uncheck again. So I guess it sets ng-hide=true
after checking the checkbox and shows up after again clicking the checkbox making <div ng-hide="$scope.bot_assistance">
to be false which is what I want it to work but After page load it doesn't show the ng-hide block. Why is it so can anyone help me out. Thanks in advance.
Upvotes: 0
Views: 785
Reputation: 4622
$scope
inside the template (are you really using $scope.$scope
inside your controller?)ngInit
bot_assistance='false'
Upvotes: 2