Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Created February 16, 2015 03:06
Show Gist options
  • Save jdcauley/b702c0040c8ed3d37c9d to your computer and use it in GitHub Desktop.
Save jdcauley/b702c0040c8ed3d37c9d to your computer and use it in GitHub Desktop.
/*
(function() {
// var app = angular.module('archiveCards', ['ngRoute', 'ngResource', 'simplePagination']);
var app = angular.module('archiveCards', ['ngRoute', 'ngResource']);
// set up configuration variables
app.run(['$rootScope', function($rootScope){
$rootScope.api = ;
$rootScope.nonce = WPAPI.api_nonce;
$rootScope.dir = WPAPI.template_url;
}]);
// example controller
app.controller('cardsController', ['$scope', '$http', 'Pagination', function($scope, $http, Pagination){
app.controller('cardsController', ['$scope', '$http', function($scope, $http){
$http.get(
'http://oringapi.cauley.co/archive_cards'
).success(function(data, status, headers, config){
$scope.cards = data;
console.log(data.length);
// $scope.pagination = Pagination.getNew(18);
// $scope.pagination.numPages = Math.ceil($scope.cards.length/$scope.pagination.perPage);
console.log('success');
}).error(function(data, status, headers, config){
console.log('error');
});
}]);
})();
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment