I want to inject One Controller to Service.
I use AngularJs and Laravel and glup-ng-annotate.
/* DialogController*/
(function(){
"use strict";
angular.module("music.controllers").controller('DialogController', function( $scope, $mdDialog ){
$scope.hide = function() {
$mdDialog.hide();
};
$scope.cancel = function() {
$mdDialog.cancel();
};
$scope.answer = function(answer) {
$mdDialog.hide(answer);
};
});
})();
And this is Service
/* Service */
(function(){
"use strict";
angular.module("music.services").factory('DialogService', function( $mdDialog, DialogController){
return {
fromTemplate: function(template, $scope ) {
var options = {
controller: DialogController,
templateUrl: template
};
if ( $scope ){
options.scope = $scope.$new();
}
return $mdDialog.show(options);
},
alert: function(title, content){
$mdDialog.show(
$mdDialog.alert()
.title(title)
.content(content)
.ok('Ok')
);
}
};
});
})();
I have this error
Error: [$injector:unpr] Unknown provider: DialogControllerProvider <- DialogController <- DialogService