Angular Dialog with Angular Form

I have an Angular application and I use Angular-Material among other components. Is it possible to open the Angular tab dialog with a downloadable TemplateUrl that contains an Angular form? How could you link to this form, if at all possible? Here is the code I use to open the dialog:

$scope.showTabDialog = function(ev) { $mdDialog.show({ controller: DialogController, templateUrl: 'pages/properties/tabDialog.tmpl.html', parent: angular.element(document.body), targetEvent: ev, clickOutsideToClose:true }) .then(function(answer) { $scope.status = 'You said the information was "' + answer + '".'; }, function() { $scope.status = 'You cancelled the dialog.'; }); }; 

Any help would be appreciated, thanks

+6
source share
1 answer

Not sure if I understand your question correctly, but for basic use, pass locals to your context and return your information to $mdDialog.hide

  $mdDialog.show({ targetEvent: $event, template: dialogContent, controller: 'DialogController', locals: { info: $scope.info } }).then(function(info) { if(info) { $scope.info.userName = info.userName; } }); 

...

 $mdDialog.hide(info); 

See this Pen Pen:

http://codepen.io/anon/pen/BjqzJR

+3
source

All Articles