Skip to content

Instantly share code, notes, and snippets.

@alexhidalgo
Created March 1, 2015 23:29
Show Gist options
  • Save alexhidalgo/c8f045d7b817a34ad792 to your computer and use it in GitHub Desktop.
Save alexhidalgo/c8f045d7b817a34ad792 to your computer and use it in GitHub Desktop.
.controller('JournalCtrl', function($scope, $http, $interval) {
$interval(function() {
$http.get('http://tiny-pizza-server.herokuapp.com/collections/alex-hackathon-journal1')
.success(function(response){
$scope.messages = [];
for( var i = 0; i < response.length; i++ ) {
if(response[i].plantType && response[i].plantQuantity && response[i].plantNotes) {
$scope.messages.push(response[i]);
}
}
})
.error(function(err){
console.log(err);
});
console.log('Journal call');
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment