0

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?

andersh
  • 8,105
  • 6
  • 39
  • 30
  • http://stackoverflow.com/questions/11249768/angularjs-ng-cloak-ng-show-elements-blink – Vegar Jan 28 '14 at 08:09
  • ok. I thought it would be enough for you to see that you needed two things: `ng-cloak` and a css-rule. – Vegar Jan 28 '14 at 08:31
  • (I deleted my previous comment by mistake:) The answer to the other question you are referring to provides additional and valuable information, but it does not answer my question, which is how do I achieve this... – andersh Jan 28 '14 at 08:39

1 Answers1

1

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

TestersGonnaTest
  • 1,017
  • 2
  • 9
  • 21