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) {
$mdDialog.show({
locals:{
profileId: id
},
controller: ['$scope', 'profileId', function($scope, profileId) {
var self = this;
self.profileId= profileId;
}],
controllerAs: 'profileCtrl',
templateUrl: 'view/profile.html',
parent: angular.element(document.body),
clickOutsideToClose:true
})
}
I want tp pass profileId to profileController and display profile data. In profile controller i get data as this
function profileController($scope,..., profileId){
}
but this error apear in console
Error: [$injector:unpr] Unknown provider: profileIdProvider <- profileId<- ProfileController
what is this error and how to fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…