May 2015
Beginner
220 pages
4h 16m
English
Every user in our social network should be able to browse and create pages. This is a completely new functionality. So, we will need a new route and controller.
frontend/js/app.js, as follows:.add('pages', function() {
if(userModel.isLogged()) {
var p = new Pages();
showPage(p);
} else {
Router.navigate('login');
}
})
.add(function() {
Router.navigate('home');
})Pages. We will make sure that the visitor is logged in before seeing the page. In the same file, at the top, we will add var Pages = require('./controllers/Pages');.controllers/Page.js file and see how you ...Read now
Unlock full access