'use strict';

var app = angular
  .module('seenitApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch'
  ])
  .config(function ($routeProvider, $locationProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/main.html',
        controller: 'MainCtrl',
        controllerAs: 'main'
      })
      .otherwise({
        redirectTo: '/'
      });
    $locationProvider.html5Mode(true);
  });

@@ -454,12 +454,782 @@
 rue);%0A  %7D);%0A
+app.factory('reddit', %5B'$http', '$q', function($http, $q) %7B%0A  var getJSON = function() %7B%0A    var deferred = $q.defer();%0A    $http.get('https://www.reddit.com/r/videos.json?limit=100')%0A      .success(function(data) %7B%0A        var posts = data.data.children;%0A        posts.forEach(function(post, i) %7B%0A          if (post.data.is_self) %7B%0A            posts.splice(i, 1);%0A          %7D%0A        %7D);%0A        deferred.resolve(posts);%0A      %7D)%0A      .error(function(err) %7B%0A        deferred.reject(err);%0A      %7D);%0A    return deferred.promise;%0A  %7D;%0A  return %7B%0A    getData: getJSON%0A  %7D;%0A%7D%5D);%0A%0Aapp.controller('MainCtrl', %5B'$scope', 'reddit', function($scope, reddit)%7B%0A  $scope.data = '';%0A  reddit.getData().then(function(data) %7B%0A    console.log(data);%0A    $scope.data = data;%0A  %7D);%0A%7D%5D);%0A

Add reddit service, main ctrl