When does angularjs use ui-router to pull data?
天蓬老师
天蓬老师 2017-06-22 11:53:13
0
1
927

Use ui-router for routing. When some pages are entered, data must be obtained from the background.

Should I pull the data in the resolve of the ui-router, or use the service in the controller of the page to pull the data?

What are the advantages and disadvantages of the two methods?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
三叔

In ui-router, the data is obtained first and then the page is loaded. In the controller, the page is rendered first and then the data is obtained.
When your ui-router request times out or errors, this page will not be displayed, giving people an abrupt feeling.
You can operate the data in the controller, which is better. This is how I understand it.

Flash~ (●'◡'●)ノ♥

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template