Whatever I try to do I can't seem to pass data to a modal controller.
I tried using resolve:
var opts = {
backdrop: true,
keyboard: true,
backdropClick: true,
templateUrl: 'views/details/basic/view.html',
controller: 'BoxDetailsCtrl'
resolve: {
item: function () {
return angular.copy(item)
},
price: function (){ return 100; }
}
this.d = this.d || $dialog.dialog($scope.opts);
this.d.open();
I tried passing the scope:
var opts = {
scope: $scope
...
In my dispair I event tried hacking the dialog service:
if (self.options.controller) {
var ctrl = $controller(self.options.controller, locals);
ctrl.modal = self.options.modal; // nasty hack
self.modalEl.children().data('ngControllerController', ctrl);
}
Nothing worked. I can't seem to be able to pass data to BoxDetailsCtrl. Any ideas?
Cheers,