Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
  2.  
  3. angular.module('starter.controllers', [])
  4. .controller('PlaylistsCtrl', ['$scope', 'photosFactory', '$http', function ($scope, $http, Util, $ionicLoading, $location, photosFactory) {
  5.  
  6. $ionicSideMenuDelegate.canDragContent(true);
  7.  
  8. $scope.allDeals = [];
  9.  
  10.  
  11. $scope.navigate = function(url){
  12. $location.path(url);
  13. };
  14. photosFactory.getPhotos().success(function(data){
  15. $scope.allDeals= data;
  16.  
  17. });
  18. }])
  19.  
  20. angular.module('starter.services', [])
  21.  
  22. .factory('photosFactory', function($http) {
  23. return{
  24. getPhotos : function() {
  25. return $http({
  26. url: 'http://www.somecompany.co.uk/bigcapi/feeds/deals/company_id/88',
  27. method: 'GET',
  28. params: {all: '1', mobileready: 1}
  29. })
  30. }
  31. }
  32. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement