You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jesper Lindström edited this page Jun 8, 2014
·
1 revision
Controllers are located in app/controllers/*.js and are supposed to listen for a specific URL and respond appropriately, with a view or certain action.
app.core.router.get('/page',function(){// Render the view app/views/page.html and output it at #mainapp.core.view.render('page',{name: 'Jesper'},'#main');});
The third argument of app.core.view.render() which is the CSS selector, is optional and defaults to #main. It also accepts a callback function with one argument, which will contain the rendered HTML. If you want to do something after the view has loaded, you can pass a callback function (without any arguments) as the fourth argument.