Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngDialog : Uncaught TypeError: Cannot read property 'data' of undefined #577

Open
suhasbhatta opened this issue Oct 7, 2017 · 2 comments

Comments

@suhasbhatta
Copy link

ngDialog version : 1.3.0
angular js version : 1.6.4
Affected browser : Google Chrome
don't have JSFiddle

I am using ng-dialog with data as options
var data = { title : title, msg : msg }; var dialog = ngDialog.open({ template: 'successDialog', plain: false, showClose: true, overlay:false, closeByDocument : true, data:data, className: 'ngdialog-theme-default' });

when i log the data, data is there, still it shows Cannot read property 'data' of undefined

I am expecting to run the ng-dialog without any error. Since it runs in all other occurrences.

@mahmah2
Copy link

mahmah2 commented Feb 21, 2020

It happens to me as well. Not clear what is the reason.

@mahmah2
Copy link

mahmah2 commented Feb 21, 2020

my case was resolved by using local variables as the data storage instead of anonymous data.
So instead of using:
ngDialog.open({ .... data:{ ..... }, ...... });

I used:

vm.DataForDialog = { .... };
.
.
.
ngDialog.open({  .... data:vm.DataForDialog,  ...... });

And then after, close() method didn't complain about missing data property!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants