
#angularjs
`
function getTemplates() { model.loading = true;`
``` Template.types.query().$promise.then(function (response) {```
model.media = response.media;
``` });```
Template.categories.query().$promise.then(function (response) {
``` model.categories = response.categories;```
});
``` Template.attributes.query().$promise.then(function (response) {```
model.attributes = response.attributes;
``` });```
``` Template.templates.query().$promise.then(function (response) {```
model.templates = response.templates;
``` });```
model.loading = false;
``` }```
jak w angularze wywołać model.loading = false` dopiero gdy wszystkie query się skończą?- Najlepsze
- Wszystkie komentarze
konto usunięte
1
@qwelukasz: $q.all


![vorky - Piast Gliwice [3] - 1 Cracovia | akcja sezonu jest już znana, Andreas Katsant...](https://wykop.pl/cdn/c3201142/2876c9dbb361ba5e89e970f987b9ad83be46d8b3ed76d1fb190e76116495f50c,w150h100.jpg?author=vorky&auth=e1e12056c8c0bf72b292a89288ae1f8f)




