initial data loading in angularjs

前端 未结 4 1298
借酒劲吻你
借酒劲吻你 2021-02-05 04:19

When building a web app where every page depends on many data sources, what\'s the best way to fetch the initial bits of data? When I look at twitter, I see the tweets that are

4条回答
  •  灰色年华
    2021-02-05 05:14

    You'll be referencing your controller anyway on page load, so you won't have to have an inline script tag.

    You can either set a default model and use the attribute ng-bind on initial load, or call a function to pass back data.

    It's pretty typical to fetch data on load in angularjs.

提交回复
热议问题