Hacker News new | ask | show | jobs
by really_operator 3531 days ago
To reduce the need for ng-cloak, use ng-bind

<p ng-bind="value"></p>

instead of

<p>{{value}}</p>

It is preferable to use ngBind instead of {{ expression }} if a template is momentarily displayed by the browser in its raw state before Angular compiles it. Since ngBind is an element attribute, it makes the bindings invisible to the user while the page is loading.

1 comments

Interesting, I forgot about ng-bind (honestly it's a pattern I never see on the web). That is, for sure, the superior pattern.