AngularJS - extending module with own types / providers
I want to ad a new (dialog) type to angular, so I could use it just like I use module.directive , module.filter , module.controller to register directives, filters and controllers. I want to register my instances of dialog type this way: module.dialog('prompt',function(dependencies){ return { templateUrl:'prompt.html', controller:function($scope){}, something:'value' } }); I also want to be able to use registered dialogs in controllers (dependency injection) module.controller('ListCtrl',function($scope,prompt){ $scope.deleteItem = function(item){ prompt('Do you want to delete this item?').then