archive for the ‘javascript’ Category

Scaffolding an Angular + Bootstrap App

March 16th, 2017
snohomish river Given the complexity of modern JavaScript web applications, it makes sense to use a scaffolding tool to set up. Fountainjs is a good way to go if you want to have your app built and served with Gulp, Sass and Webpack. This post is about adding Bootstrap the the mix. And how to fix everything that Bootstrap breaks.

Pretty Permalinks with Angular UI-Router

February 23rd, 2017
Pretty Permalinks with Angular UI-Router Problem: how to get Wordpress-style pretty permalinks into an Angular app? I want my permalinks to have this format: I want single posts and category and tag archives to contain slugs, not IDs in the URL. This is not hard to achieve with Angular UI-router. This is how I do it..

Pagination with UI-Router and WP-API

February 22nd, 2017
Pagination with UI-Router and WP-API

I added pagination to this site’s headless theme. Its and Angular client for a WordPress API.

The key to this is knowing what Angular’s ui-router can do. This post by Aviv Ben-Yosef was very helpful: Simple pagination and URL params with ui-router. It explains how to set up routes with ‘squashed’ parameters, and make simple pagination functions in your controller.

Another helpful find was in Kadam White’s wpapi utility, which does the actual interaction with my WordPress JSON API.…

Multiple cursor shortcuts

January 22nd, 2017
Multiple cursor shortcuts

Using text editors these days is so nice! I’m a big fan of Atom. The best part of course is the multiple cursor feature, which Atom shamelessly copied from Sublime Text. My only trouble is not remembering the keyboard shortcuts.

So, I made this little cheat sheet. I printed it, and kept it near my monitor at work. Problem solved—almost. I had to keep that silly piece of paper around.…

An Angular Client for a WordPress site

January 20th, 2017

I coded up an Angular 1.5 app that shows the posts from my WordPress blog. It fetches post data from this site’s Rest API.

A proof-of-concept is here: Cherrytree.

The repo is on my Github: Topheavy-Angular.

It shows a ‘default’ listing of posts on the front page, which is equivalent to the default WordPress loop. I has single post views with the same URL structure as my WordPress permalinks.…