Created
August 29, 2016 15:37
-
-
Save n8finch/ca40070992824be2842021b07ef2f07d to your computer and use it in GitHub Desktop.
angular-basic-http.js
This file contains 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 (angular) { | |
'use strict'; | |
angular.module('myApp', []) | |
.controller('example', ['$scope', '$http', function ($scope, $http) { | |
$http({ | |
url: 'https://n8finch.dev/wp-json/wp/v2/posts', | |
cache: true | |
}).success(function (res) { | |
$scope.posts = res; | |
console.log(res); | |
}); | |
}]); | |
})(window.angular); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment