Ember WordPress test 1

jetpackAfter installing WordPress Jetpack on the broerse.net WordPress site and some config work it is possible access this json data:


To create an Ember site like https://broerse.net/ember/wp1/ download the Ember Starter kit from http://emberjs.com/ and replace app.js and index.html with these files:


<!DOCTYPE html>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/style.css">
  <script type="text/x-handlebars">
    <h2>Welcome to Ember.js</h2>


  <script type="text/x-handlebars" id="index">
      <li> {{title}} </li>

  <script src="js/libs/jquery-1.10.2.js"></script>
  <script src="js/libs/handlebars-1.1.2.js"></script>
  <script src="js/libs/ember-1.2.0.js"></script>
  <script src="js/app.js"></script>


App = Ember.Application.create();

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return Ember.$.ajax({ url: 'https://public-api.wordpress.com/rest/v1/sites/58826716/posts/?number=4', dataType: "jsonp", type: 'GET' }).then(function(data) {
      return data.posts;

That’s all there is to it. Happy Embering!


Comments are closed.