SHARE
TWEET

Untitled

a guest Dec 10th, 2014 159 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var buildProfileApp = angular.module('buildProfileApp', []);
  2.  
  3. buildProfileApp.controller('validateChannelCtrl', function($scope, $http){
  4.         var testChannelUrl = 'https://www.youtube.com/user/CrimsonKombat';
  5.  
  6.         $http({
  7.             method: 'POST',
  8.             url: '/ajax/validate-social-channel',
  9.             headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  10.             transformRequest: function(obj) {
  11.                 var str = [];
  12.                 for(var p in obj)
  13.                 str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  14.                 return str.join("&");
  15.             },
  16.             data: {url:testChannelUrl,social_type:2}
  17.         }).success(function(data){
  18.                 //alert( data.channel_id );
  19.                 $scope.channel_id = data.channel_id;
  20.         });
  21.  
  22.         $scope.test = 'Blah';
  23. });
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