Skip to content

Instantly share code, notes, and snippets.

@n8finch
Created September 18, 2016 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8finch/6de27fecf5fadf214f03a7621c844402 to your computer and use it in GitHub Desktop.
Save n8finch/6de27fecf5fadf214f03a7621c844402 to your computer and use it in GitHub Desktop.
angular.module('myApp', ['ngResource', 'ui.router'])
angular.module('myApp', ['ngResource', 'ui.router'])
//CONTROLLERS
.controller('Posts', ['$scope', '$http', function ($scope, $http) {
$http({
url: 'https://n8finch.dev/wp-json/wp/v2/posts',
cache: true
}).success(function (res) {
$scope.posts = res;
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment