html - Handling ng-show with controller value -
<div> {{vis}} <div class="dsui-visuals-section" data-ng-show="vis"></div> <div class="text-center col-sm-12" style="margin-top:200px" data-ng-show="!vis">404 not found</div> </div> this template getting vis variable controller, based on value showing 2 child div's presented.
but before getting vis variable 404 not found template loading.how avoid this? can resolve this.
initialise scope variable true value , use data-ng-hide="vis" instead of data-ng-show="!vis"
<div> {{vis}} <div class="dsui-visuals-section" data-ng-show="vis"></div> <div class="text-center col-sm-12" style="margin-top:200px" data-ng-hide="vis">404 not found</div> </div> and in controller set default value
$scope.vis=true;
Comments
Post a Comment