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') | |
.factory('dataService', dataService); | |
function dataService(logger) { | |
return { | |
getAllBooks: getAllBooks, |
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); | |
}; |
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') | |
.constant('constants', { | |
APP_TITLE: 'Book Logger', | |
APP_DESCRIPTION: 'Track which books you read.', | |
APP_VERSION: '1.0' | |
}); | |
}()); |
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') | |
.value('badgeService', { | |
retrieveBadge: retrieveBadge | |
}); | |
function retrieveBadge(minutesRead) { | |
var badge = null; |
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() { | |
var app = angular.module('app', []); | |
app.config(function($provide)){ | |
$provide.provider('books',function(){ | |
this.$get=function(){ | |
var appName = 'Book Logger'; |
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
class LoggingContextManager: | |
def __enter__(self): | |
return self | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
return |
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
class LoggingContextManager: | |
def __enter__(self): | |
return "You are in a with block" | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
return |
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
class LoggingContextManager: | |
def __enter__(self): | |
print('LoggingContextManager.__enter__()') | |
return "You are in a with block" | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
print('LoggingContextManager.__exit__({},{},{})'.format(exc_type, exc_val, exc_tb)) | |
return |
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
class LoggingContextManager: | |
def __enter__(self): | |
print('LoggingContextManager.__enter__()') | |
return "You are in a with block" | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
print('LoggingContextManager.__exit__({},{},{})'.format(exc_type, exc_val, exc_tb)) | |
return |
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
class LoggingContextManager: | |
def __enter__(self): | |
print('LoggingContextManager.__enter__()') | |
return "You are in a with block" | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
if exc_type is None: | |
print('LoggingContextManager.__exit__:' | |
'normal exit detected.') | |
else: |
OlderNewer