Jak subskrybować instancję modelu w Sails.JS?

Próbuję użyć funkcji subskrypcjiopisany tutaj. Jednak podczas edycji/assets/js/app.js, Otrzymuję ten błąd:

Uncaught ReferenceError: Room is not defined 

Nie jestem więc całkowicie pewien, dlaczego, ale nie może znaleźć mojego modelu. Oto mój kod:

Room.subscribe(req, [{id: "5278861ab9a0d2cd0e000001"}], function (response) {
  console.log('subscribed?');
  console.log(response);
});

i tutaj jest w kontekście app.js

(function (io) {

  // as soon as this file is loaded, connect automatically, 
  var socket = io.connect();
  if (typeof console !== 'undefined') {
    log('Connecting to Sails.js...');
  }

  socket.on('connect', function socketConnected() {

    // Listen for Comet messages from Sails
    socket.on('message', function messageReceived(message) {

      ///////////////////////////////////////////////////////////
      // Replace the following with your own custom logic
      // to run when a new message arrives from the Sails.js
      // server.
      ///////////////////////////////////////////////////////////
      log('New comet message received :: ', message);
      //////////////////////////////////////////////////////

    });


    ///////////////////////////////////////////////////////////
    // Here's where you'll want to add any custom logic for
    // when the browser establishes its socket connection to 
    // the Sails.js server.
    ///////////////////////////////////////////////////////////
    log(
        'Socket is now connected and globally accessible as `socket`.\n' + 
        'e.g. to send a GET request to Sails, try \n' + 
        '`socket.get("/", function (response) ' +
        '{ console.log(response); })`'
    );
    ///////////////////////////////////////////////////////////

    // This is the part I added: 
    Room.subscribe(req, [{id: "5278861ab9a0d2cd0e000001"}], function (response) {
      console.log('subscribed?');
      console.log(response);
    });
    //


   });


  // Expose connected `socket` instance globally so that it's easy
  // to experiment with from the browser console while prototyping.
  window.socket = socket;


  // Simple log function to keep the example simple
  function log () {
    if (typeof console !== 'undefined') {
      console.log.apply(console, arguments);
    }
  }


})(

Czy zamierzam to robić we właściwy sposób? czy powinienem to przechowywaćbezpośrednio w app.js?

questionAnswers(1)

yourAnswerToTheQuestion