Modal dialog
I've been trying to implement a modal dialog using the example by Dan Wahlin...
http://weblogs.asp.net/dwahlin/building-an-angularjs-modal-service
Reading through some of the posts here I now realise there is one built into the generator, but I started my project before this and I've had a few issues trying to upgrade to the latest version.
My issue is that when I use 'grunt serve' to run the project locally, using the example, everything works as expected. But when I deploy to openshift, the modal dialog stops working.
I believe this is due to the templateUrl in the modal service...
var modalDefaults = {
backdrop: true,
keyboard: true,
modalFade: true,
templateUrl: 'components/dialog/modalContent.html'
};
...and I'm not sure this is being found once the grunt build has been completed and the result uploaded to openshift. The components files get added to app.js (if I'm correct - all this is fairly new to me) and I'm not sure the reference in the modal service can locate this.
Are there any suggestions as to how I can get this to work?
I'm going to close this issue as I can't figure it out and I've managed to upgrade to the newest generator so will use the supplied modal.
Whatever the issue between testing and live builds, it's this code from the original example that is causing it!!
if (!tempModalDefaults.controller) {
tempModalDefaults.controller = function ($scope, $modalInstance) {
$scope.modalOptions = tempModalOptions; <------------ this is the problem.
$scope.modalOptions.ok = function (result) {
$modalInstance.close(result);
};
$scope.modalOptions.close = function (result) {
$modalInstance.dismiss('cancel');
};
}
}
Not sure why :)