I have a angular-bootstrap modal dialog set up as such:
var modalInstance = $modal.open({
templateUrl: '/views/core/common/modalProjectChange.html',
controller: ModalChooseProjectCtrl,
resolve: {
items: function () {
ProjectConfigurationService.getAll("", function (_prjl) {
return _prjl;
});
}
...
});
where
var ModalChooseProjectCtrl = function ($scope, $modalInstance, items) {
console.log('called ModalChoose, items' + items);
angular.forEach(items, function (value, key) {
// do stuff...
});
}
and despite items function is performing ok (I can see network connection from invoked ProjectConfigurationService which receives an array), the line 'called ModalChoose, items' + items prints that items is undefined. Please help me understand why.