Join Roy Sivan for an in-depth discussion in this video Advanced techniques, part of AngularJS and WordPress: Building a Single-Page Application.
- View Offline
- So we've created a very basic blog listing…and detail single-page application.…We've even added some custom data…to the response so that we can show…that data on the listing page.…But what else can you do with the…REST API, WordPress and Angular?…Custom routes are a great way to add custom functionality.…Modifying the response is one easy way…to make the REST API work for your needs…but creating a custom route allows you to do…something completely custom for…an endpoint like take a payment.…I went ahead and I created a new custom route…called roy and attached it to the wp/v2 namespace…which is the default namespace that comes with the plugin.…
I created a my awesome route callback function…for the GET method and I created an array…which just has some of my personal data…and sent it back with the response.…The way this works is now I can go to Chrome,…go to the route, and there's my JSONObject of that array.…So now I can do something very custom,…like maybe even get data from another API…and bring back the response and I get the JSONObject…
In this course, Roy Sivan shows how to build a single-page web app with WordPress, AngularJS, and the WordPress REST API plugin. Roy also reviews creating controllers and routes to get a basic understanding of building a multiview single-page app. Plus, get some tips to transition your single-page app to a native mobile app with AppPresser.
- Setting up WordPress
- Creating the AngularJS components, including the controller and route
- Connecting WordPress and AngularJS
- Connecting views
- Adding and displaying custom data
- Using a plugin to show advanced custom field (ACF) data on the template