Created
January 17, 2018 09:17
-
-
Save goyalrohit/f20719a883297453c20ec4db895ebd32 to your computer and use it in GitHub Desktop.
Angular Service Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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