SHARE
TWEET

Untitled

a guest Oct 18th, 2016 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('app')
  2.   .controller('DashCtrl', ['dashManager', function (manager) {
  3.     this.queries = manager.queries;
  4.   }]);
  5.  
  6. angular.module('app')
  7.   .service('dashManager', function () {
  8.     var vm = this;
  9.  
  10.     vm.queries = [];
  11.  
  12.     var ServiceQuery = Parse.Object.extend('ServiceQuery');
  13.     var query = new Parse.Query(ServiceQuery);
  14.     query.find({
  15.       success: function (results) {
  16.         results.forEach(function (item) {
  17.           vm.queries.push(item);
  18.         });
  19.       },
  20.       error: function (error) {
  21.  
  22.       }
  23.     });
  24.   });
  25.  
  26. // Template is basically just this
  27. <p>{{DashCtrl.queries.length}}</p>
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. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top