Wpis z mikrobloga

#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ą?
  • 1