WP REST API + AngularJS

The WordPress REST API combined with a JavaScript MVC framework opens up new possibilities for better, more intuitive interfaces that solve scaling and other challenges.

Insert HTML into view using AngularJS

Problem: Example controller : var SomeController = function () { this.customHtml = ‘<ul><li>render me please</li></ul>’; } Example view : <div ng:bind=”customHtml”></div> Gives : <div> “<ul><li>render me please</li></ul>” </div> Solution: <div ng-bind-html=”expression”></div> instead of <div>{{expression}}</div> This now requires the “ngSanitize” module (I got hung up on this for awhile and couldn’t …