Making your own models - how to access the app object?

48 views
Skip to first unread message

Igor Zinovyev

unread,
Mar 1, 2014, 3:55:49 PM3/1/14
to locomo...@googlegroups.com
Hello, everyone!

Perhaps this has been asked already, but I can't find it anywhere. The question is: when I want to make my own model to be used with Locomotive, how do I achieve the similar behaviour to what happens with the Controller object? For instance:

var locomotive = require('locomotive');
var Controller = locomotive.Controller;
var SomeController = new Controller();

SomeController.index = function() {
// This is what I want to achieve with my custom models
  var app = this.app;
};

Is there some way to add a model class to be recognized by Locomotive this way?

Reply all
Reply to author
Forward
0 new messages