Last active
December 28, 2015 19:58
-
-
Save samirbr/4d9ba4b8006b8335bf8a to your computer and use it in GitHub Desktop.
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
app.factory('Client', function() { | |
function Client(obj) { | |
obj.created = new Date(obj.created); | |
angular.extend(this, obj); | |
} | |
return Client; | |
}); |
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
$http.get(URL).then(function(response) { | |
$scope.clients = response.data.map(function(client) { | |
return new Client(client); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment