likeastore / ngDialog

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

ngDialog controllerAs not working when upgrade ngdialog version to 0.6.6 #596

Open ramseyfeng opened 5 years ago

ramseyfeng commented 5 years ago

Below code works perfect in ngDialog "0.5.9"

After I upgrade it to "0.6.6" or "1.4.0", it cannot work, all the data in template bound to lctrl has been lost.

ngDialog.open({
    template: 'projecta/testa.tpl.html',
    controller: 'loginCtrl',
    controllerAs: 'lctrl',
    resolve: {
        ...
    }
});

If I change it to use

controller: 'loginCtrl as lctrl', 

instead of use controllerAs, it will solve the issue.

I just want someone can help to tell me if controllerAs is deprecated? or what should be the correct way to use it?