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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -