Skip to content

Instantly share code, notes, and snippets.

View michaelbromley's full-sized avatar
👨‍💻
Writing colourful text files

Michael Bromley michaelbromley

👨‍💻
Writing colourful text files
View GitHub Profile
@michaelbromley
michaelbromley / blogService.js
Created February 5, 2015 10:56
Example Angular service used to interact with WP-API
function BlogService($http, $sce, config) {
function allPosts() {
return getData('posts?filter[category_name]=post');
}
function allPostsByTag(tag) {
return getData('posts?filter[category_name]=post&filter[tag]=' + tag);
}
@michaelbromley
michaelbromley / gist:ec0f433fecf23ba20528
Created January 22, 2015 12:43
dirPagination: Fix for issue 92
// This is a fix I have made for https://github.com/michaelbromley/angularUtils/issues/92
// If you ran into this issue, try this out. I am looking for feedback before I push to the repo.
// It's a bit hacky but the tests pass and so far looks okay to me...
/**
* dirPagination - AngularJS module for paginating (almost) anything.
*
*
* Credits
* =======