AngularJS: show loading HTML until data is loaded

后端 未结 4 883
Happy的楠姐
Happy的楠姐 2020-12-23 14:35

How do I have AngularJS show a loading spinner until the data has finished loading?

If my controller has $scope.items = [{name: \"One\"}] set up statica

4条回答
  •  一生所求
    2020-12-23 15:19

    I would create custom directive and put default markup with spinner.

    Here are some links on custom directives

    1) Egghead videos are awesome! http://www.egghead.io/video/xoIHkM4KpHM

    2) Official Angular docs on directives http://docs.angularjs.org/guide/directive

    3) Good overview of angular in 60ish minutes http://weblogs.asp.net/dwahlin/archive/2013/04/12/video-tutorial-angularjs-fundamentals-in-60-ish-minutes.aspx

提交回复
热议问题