3 ms·
> Another option is to completely hide elements, or even your whole application, until Angular is ready. Angular provides ng-cloak to this end. My issue with t
by avolcano 13y ago
> Another option is to completely hide elements, or even your whole application, until Angular is ready. Angular provides ng-cloak to this end.
My issue with this is that it doesn't solve the problem of binding to asynchronously-loaded resources. You have to manually implement your own ng-cloak logic, or use ng-bind, to not have {{mustaches}} waiting for data to be loaded.
Compare to Ember, where {{mustache'd}} data-bound bits aren't rendered until their bound variable is defined.
(the, other fix, of course, is to do something like `<span ng-hide="foo != undefined">{{foo}}</span>`, but that doesn't scale particularly well)
- oinksoft 13y agoYou are somewhat misinformed: If you are using more than one template, this is a non-issue. Only the HTML from the initial page load will ever display template bindings, that being the purpose of ng-cloak, ngBind, etc. $templateCache can be pre-loaded with something like the ng-templates Grunt task, so excessive HTTP requests are not an issue either.