javascript - ng-show/ng-hide doesn't work with lazy load of controller -
i loading state oclazyload. controller of state has code in start.
$scope.test = {show: false};
and in html view have this
<button class="btn" ng-show="test.show">hey there</button>
now when view loaded button not hidden. if log {{test.show"}} shows false. not applying button.
i tried execute controller when view loaded
$scope.$watch('$viewcontentloaded', function() { $timeout(function() { },0); });
but nothing working.
while ng-show/ng-hide
not working ng-if works perfectly. not able understand why ng-show doesn't work , ng-if
works. need use ng-show/ng-hide
try it.
<button class="btn" ng-hide="!test.show">hey there</button>
Comments
Post a Comment