In-depth guide: testing connection

In this section:

One can test the connection in the console using the following:

  var Restaurant = module["default"];
  return Restaurant.getList({});
  console.log( restaurants.attr() );

However I get the following error:

VM350:1 Uncaught ReferenceError: System is not defined(…)

I have tried in the app (http://localhost:8080/) and well as the api (http://localhost:8080/api).

What am I missing?

OK, turns out it is the order of instructions.

The testing bit works after one completes the ‘Add data to the page’ bit. However, that comes after the test so it should possibly just be moved.