I am loading a state with ocLazyLoad. The controller of that state has this code in the start.
$scope.test = {show: false};
and in html view I have this
<button class="btn" ng-show="test.show">Hey There</button>
Now when my view is loaded the button is not hidden. if I log {{test.show"}} it shows false. But this is not applying to button.
I tried something like this to execute controller when view is loaded
$scope.$watch('$viewContentLoaded',
function() {
$timeout(function() {
},0);
});
but nothing is working.
while ng-show/ng-hide
is not working ng-if works perfectly. I am not able to understand why ng-show doesn't work and ng-if
works. I need to use ng-show/ng-hide