I want to pass some data to $mdDialog. In fact, I have two controllers in a separate file. Here is my controller code
function openDialog(id) {
$mdDi
I think you must do this:
controller: ['$scope', function($scope) {
var self = this;
self.profileId= $scope.profileId;
}]
Your profileId Is in the scope.
You can use locals to pass data: Exemple from official website:
function showDialog($event) {
var parentEl = angular.element(document.body);
$mdDialog.show({
parent: parentEl,
targetEvent: $event,
template:
'' +
' '+
' '+
' '+
' Number {{item}}
' +
' '+
' '+
' ' +
' ' +
' ' +
' Close Dialog' +
' ' +
' ' +
' ',
locals: {
items: $scope.items
},
controller: DialogController
});
Where items is a data passed to the dialog