Skip to content

Instantly share code, notes, and snippets.

@syrxw
Created June 6, 2015 15:23
Show Gist options
  • Save syrxw/ff1ce5ee5f3be8f8e7cb to your computer and use it in GitHub Desktop.
Save syrxw/ff1ce5ee5f3be8f8e7cb to your computer and use it in GitHub Desktop.
angular.module('app', ['ngRoute'])
.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
templateUrl: myLocalized.partials + 'main.html',
controller: 'Main'
});
})
.controller('Main', function($scope, $http, $routeParams) {
$http.get('wp-json/posts/').success(function(res){
$scope.posts = res;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment