Sharing data between AngularJS controllers but having the shared data come from an Ajax call

后端 未结 2 2005
夕颜
夕颜 2021-02-20 07:32

I\'ve figured out how to share data between two AngularJS controllers using a shared service in the contrived example below:

(Functioning fiddle)

var app         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-20 08:00

    Here are some starting points to help you out:

    1. How to get the data from the server (and how to construct a basic 'model' service): SO post

    2. How to hold the controller execution until data is fetched from the server: screencast from egghead.io

提交回复
热议问题