I have seen this answer of question Extend existing service in angular where concept of decorator in angularjs is doing right things for the same
app.config(function($provide) {
$provide.decorator('growl', function($delegate) {
$delegate.add = function(message, type) {
// implementation for add.
};
return $delegate;
});
});
but my question is
Is decorator in AngularJS the best way to extend the existing service?
Or there are some other functionality related to extend existing service in AngularJS?