SHARE
TWEET
Untitled
a guest
Jan 16th, 2016
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- var StatsController = function($scope, $state, $ionicPopup, $ionicHistory, $stateParams) {
- $scope.stats = {}; //Form model
- var Stats = Parse.Object.extend("Stats");
- var timestamp = Number($stateParams.date);
- var id = null;
- var query = new Parse.Query(Stats);
- query.equalTo("timestamp", timestamp);
- query.find().then(function(results) {
- if (results.length > 0) {
- id = results.id;
- $scope.stats.water = results[0].attributes.water;
- $scope.stats.soda = results[0].attributes.soda;
- $scope.stats.coding = results[0].attributes.coding;
- $scope.stats.tv = results[0].attributes.tv;
- $scope.stats.bed = results[0].attributes.bed;
- $scope.stats.wake = results[0].attributes.wake;
- $scope.stats.waste = results[0].attributes.waste;
- $scope.stats.mood = results[0].attributes.mood;
- $state.$apply;
- }
- });
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
