SHARE
TWEET

Untitled

a guest Dec 17th, 2014 3 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.controller("IdeasCtrl", function($scope, $http) {
  2.  $http.get('ideas/find').
  3.     success(function(data, status, headers, config){    
  4.     $scope.ideas = data;
  5.     });  
  6.    
  7.  $scope.urlcount = function() {
  8.     angular.forEach($scope.ideas, function(value, key) {
  9.         var currenturl = key.url;
  10.         http.get('https://graph.facebook.com/?'+currenturl).
  11.         success(function(data, status, headers, config){
  12.             this.push(data.shares);
  13.         });
  14.     });
  15.  };
  16. });
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