andersh
andersh

Reputation: 8383

Initially hide elements when using angular.js

In the example below I do not want the values "A" og "B" to be visible until JavaScript has been loaded and $scope.displayA has been set by the return of some ajax call.

<span ng-show="displayA">A</span>
<span ng-hide="displayA">B</span>

What is the best way to achieve this?

Upvotes: 0

Views: 326

Answers (1)

TestersGonnaTest
TestersGonnaTest

Reputation: 1027

Just use ng-cloak on them. Link to docs: http://docs.angularjs.org/api/ng.directive:ngCloak

Upvotes: 1

Related Questions