I have a philosophy question about AngularJS and directives but correct implementation of the next problem solves it. So,
- I need an AngularJS directive,
- It loads some data via several (not one!)
$http
requests, - It shows it,
- It updates data (and re-shows it) every second,
- The view has to be unchanged while data is loading/reloading.
How should I do it in a correct way?
And what about if I need a controller but not directive? (Difference is that controllers have resolve
options but directives don't.)
P.S.: I need a concrete scheme or a code! I know which components ($http
, $q
, etc.) I have to use. I don't know how to do it in a right way!