likeastore / ngDialog

Modals and popups provider for Angular.js applications
http://likeastore.github.io/ngDialog
3.14k stars 692 forks source link

ngDialog - modal window is not shown up after deploying #551

Closed HemavathiJ closed 7 years ago

HemavathiJ commented 7 years ago

I am using ngDialog 1.0.1, Angular js 1.5 with typescript 2.1.4

ngDialog is working fine in local & not working after deploying..!

When i remove the "controller" property, then modal window works fine.

here is my code:

`showPinVerificationModal(email,name) { const dlgConfig = { template: require('./modal.tpl.html'), plain: true, className: 'ngdialog-theme-modalService ngdialog-theme-modalService-Width800', controller: this.PinVerifcationModalCtrl, resolve: { email: function () { return email; }, name: function () { return name; } } };

return this.ngDialog.openConfirm(dlgConfig); }

private PinVerifcationModalCtrl($scope,email,name) { $scope.Email = email; $scope.Name = name; }`

your help is appreciated!

HemavathiJ commented 7 years ago

I found the fix myself. In above code, inline controller is not minification safe. updated code:

`showPinVerificationModal(email,name) { const dlgConfig = { template: require('./modal.tpl.html'), plain: true, className: 'ngdialog-theme-modalService ngdialog-theme-modalService-Width800', controller: ['$scope','email','name', this.PinVerifcationModalCtrl], resolve: { email: function () { return email; }, name: function () { return name; } } };

return this.ngDialog.openConfirm(dlgConfig); }

private PinVerifcationModalCtrl($scope,email,name) { $scope.Email = email; $scope.Name = name;