Created
March 1, 2015 23:29
-
-
Save alexhidalgo/c8f045d7b817a34ad792 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
.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