Building theme components with the WP REST API and Angular.js
Nathan Shubert-Harbison
@_nathansh nathansh.com
The beardo == total nerd
- 1998 (web and music)
- Musicians
- Band sites (tables -> css -> flash)
- Small businesses
- Music school
- Freelance, agnecies, Domain7Workaround needed for PDF with image only slide
Workaround needed for PDF with image only slide
Workaround needed for PDF with image only slide
Workaround needed for PDF with image only slide
The WP REST API
Lot of ground, questions at end, happiness bar.What is an API anyways?
- Application Program Interface
- Means to hook into an application
- Most web APIs are around data
- Functionality like iOS camera, Google geotaggingREST
- Approach to architecture
- Simple, lightweight, powerful
- Instagram, Twitter, etc
- Often return jsonWhy do we want this in WordPress?
Data portability
- Apps
- Other apps
- Aggregation and feeds
- Mashups! Can be backend for own data apps
Access our own data differently
JSWhat about XML-RPC and RSS?
- XML-RPC is really difficult to use
- Also, it's 2015
- XML is harder to consume than JSON
- RSS isn't customizable by the consumer
- Where's the Twitter XML-RPC API, huh?Haig did amazing things with this
Everything you've always wanted
CRUD
Main version, stable, in production.It's the future
- Has gained tons of traction
- Will be in core
- Themes can use it today
- JobsAngular.js
- MVW JavaScript frameworkWhy should I care about Angular.js?
- Templating system is preeeetty great
- Great and dealing with AJAX
- Easier than jQuery for templating and AJAX
- Component to single page app
- Community adoption/support
- Jobs 💰💰💰
WP REST API + Angular.js = ❤️
Workaround needed for PDF with image only slide
Demo project, slides and links
Contact me
- nathansh.com
- @_nathansh
- github.com/nathanshubert
Building theme components with the WP REST API and Angular.js
Nathan Shubert-Harbison
@_nathansh nathansh.com