Opposite of ng-cloak for loading message

后端 未结 3 1627
刺人心
刺人心 2021-02-05 01:33

I don\'t know if this exists in the AngularJS framework, but essentially I\'m looking for the opposite of ng-cloak, which hides elements until the page is compiled. I was looki

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 02:23

    I have resolved this using a somewhat hacky method as follows. The following HTML is added at the end of the main page.

    Loading

    The message is shown across the entire browser until the page is compiled, at which point ng-show takes over and hides the loading message.

    EDIT: Angular 1.3+ lets you use the :: expression to prevent evaluating the expression in every digest cycle. https://docs.angularjs.org/guide/expression#one-time-binding

提交回复
热议问题