Created
February 16, 2015 03:06
-
-
Save jdcauley/b702c0040c8ed3d37c9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
(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