m-e-conroy / angular-dialog-service

A complete AngularJS service with controllers and templates for generating application modals and dialogs for use with Angular-UI-Bootstrap and Twitter Bootstrap
MIT License
618 stars 227 forks source link

Allow the ControllerAs syntax #85

Closed samudurand closed 8 years ago

samudurand commented 9 years ago

It would be really nice if it was possible to add a parameter allowing to set the 'ControllerAs' attribute of the modal. For a classic modal I would do something like :

function openListCreationForm() {
   var modalInstance = $modal.open({
   templateUrl: 'app/home/listCreationForm.tpl.html',
   controller: 'ListCreationModalController',
   controllerAs: 'lcf'
 });

 modalInstance.result.then(function () {
 }, function () {});
 }

for this project you could modify slightly your syntax with a parameter 'lcf' like this :

var dlgs = dialogs.create('app/home/listCreationForm.tpl.html', 'ListCreationModalController','lcf', {}, 'lg');

m-e-conroy commented 9 years ago

I'll add this as a TODO, the service was created back when controllerAs wasn't available.

samudurand commented 9 years ago

:+1:

venil7 commented 8 years ago

desperately need this functionality

niemyjski commented 8 years ago

Can you submit a pull request for this.

venil7 commented 8 years ago

https://github.com/m-e-conroy/angular-dialog-service/pull/158

niemyjski commented 8 years ago

Change looks good to me. @samudurand can you test and verify it's good. Once I hear back I'll merge it.

niemyjski commented 8 years ago

Merged

niemyjski commented 8 years ago

@m-e-conroy 5.2.11 has been pushed

m-e-conroy commented 8 years ago

Sweet, thanks. Sorry haven't been able to participate much lately. On Dec 10, 2015 12:07 PM, "Blake Niemyjski" notifications@github.com wrote:

@m-e-conroy https://github.com/m-e-conroy 5.2.11 has been pushed

— Reply to this email directly or view it on GitHub https://github.com/m-e-conroy/angular-dialog-service/issues/85#issuecomment-163689224 .