Skip to content

Instantly share code, notes, and snippets.

@goyalrohit
Created January 17, 2018 09:17
Show Gist options
  • Save goyalrohit/f20719a883297453c20ec4db895ebd32 to your computer and use it in GitHub Desktop.
Save goyalrohit/f20719a883297453c20ec4db895ebd32 to your computer and use it in GitHub Desktop.
Angular Service Function
(function() {
angular.module('app')
.service('logger', BookAppLogger);
function LoggerBase() { }
LoggerBase.prototype.output = function(message) {
console.log('LoggerBase: ' + message);
};
function BookAppLogger() {
LoggerBase.call(this);
this.logBook = function(book) {
console.log('Book: ' + book.title);
}
}
BookAppLogger.prototype = Object.create(LoggerBase.prototype);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment