I am trying to run AngularUI Modal, but it gives me an error ($ uibModal - undefined) as well as a headache.
I am using angular -ui-bootstrap-0.14.3 version. (so it uses $ uibModal, not $ modal)
The error shows the line var modalInstance = $ uibModal.open ({...
This is a shortened version of my controller (which contains a click event)
'use strict';
angular.module('MPAapp')
.controller('workCentreCtrl',
['$scope', '$rootScope', 'toastrFactory', 'workCentreResource',
workCentreCtrl])
function workCentreCtrl($scope, $rootScope, toastrFactory, workCentreResource, $uibModal, $log) {
$scope.EditWorkOrder = function (slot, max) {
var modalInstance = $uibModal.open({
animation: true,
templateUrl: '/app/WorkOrder/Views/EditWorkOrder.html',
controller: 'EditWorkOrderCtrl',
size: 'lg',
resolve: {
Slot: function () {
return slot;
},
Max: function () {
return max;
}
}
});
modalInstance.result.then(function (selectedItem) {
$scope.selected = selectedItem;
}, function () {
$log.info('Modal dismissed at: ' + new Date());
});
console.log('md opened')
};
}
This is the host controller.
'use strict';
angular.module('MPAapp')
.controller('EditWorkOrderCtrl', ['$scope', '$timeout', 'toastrFactory', 'workCentreResource', 'blockedDatesResource',
EditWorkOrderCtrl]);
function EditWorkOrderCtrl($scope, $timeout, toastrFactory, workCentreResource, blockedDatesResource, $uibModalInstance, Slot, Max) {
};
Any ideas on this would be greatly appreciated. itsdanny.