Angularjs: How does the Angular hide and show elements?where should I modify the elements? -
i'd hide angular app until view rendered. propable have hide using style="display:none":
<div id="app-content" style="display:none"> <!-- angular app html code --> </div>
i have tried this, won't work, because angular not modify style.display value.
<div id="app-content" style="display:none" ng-show="1">
how angular hide elements, should modify style.display, or there better solution?
how angular show , hide elements?
this depends on boolean
(true
or false
) value
ng-show :
ng-show="true"
samestyle="display:block"
ng-show="false"
samestyle="display:none"
ng-hide :
this same ng-show depends on true
or false
value
ng-hide="true"
samestyle="display:none"
ng-hide="false"
samestyle="display:block"
if use ng-show
or ng-hide
, don't need call display
properties in style
where should modify style.display, or there better solution?
you don't need style.display
if using angular.js
. try ng-show
, ng-hide
.
if use ng-show
or hide
, can changes in controller.
like below
<div ng-show="modelname">......
you need modify modelname
in controller.
function controllername($scope) { $scope.modelname="true"// or false }
Comments
Post a Comment