Skip to content

Instantly share code, notes, and snippets.

@n8finch
Created September 19, 2016 03:44
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/78f4802ce3749ad6e3db2e491c5c3463 to your computer and use it in GitHub Desktop.
Save n8finch/78f4802ce3749ad6e3db2e491c5c3463 to your computer and use it in GitHub Desktop.
pageView-controller-genesis-angular-gulp.js
.controller('pageView', ['$scope', '$http', '$stateParams', function ($scope, $http, $stateParams) {
console.log('pageView running');
$http({
url: 'https://n8finch.dev/wp-json/wp/v2/pages?filter[name]=' + $stateParams.slug,
cache: true
}).success(function (res) {
$scope.post = res[0];
});
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment