TLDR; This tutorial advises to delete the folders bin, views, routes altogether, and I wonder if that is the convention when using the MEAN stack.
I am new to MEAN stack and I am confused by the conflicts between the server and client. More specifically, I am not sure which files from Express I should replace with Angular files.
shoppingMall
..bin
..data
..node_modules
..public
....images
....javascripts
....stylesheets
..routes
....index.js
....users.js
..views
....index.jade
....layout.jade
..app.js
..package.json
Here are my specific questions:
- Do I use
views/index.jadeat all or must I createpublic/views/index.html? Am I right if I think the first is server-side html rendering while the latter is client-side html rendering? - What do I do with routing?
routes/index.jsis a routing file provided by Express but doesn't Angular also provide a$routeProvider?
routes/index.js
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res) {
res.render('index', { title: 'Express' });
});
module.exports = router;
$routeProvider example
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'MainCtrl'
})
.when('/shows/:id', {
templateUrl: 'views/detail.html',
controller: 'DetailCtrl'
})
.when('/login', {
templateUrl: 'views/login.html',
controller: 'LoginCtrl'
})
.when('/signup', {
templateUrl: 'views/signup.html',
controller: 'SignupCtrl'
})
.when('/add', {
templateUrl: 'views/add.html',
controller: 'AddCtrl'
})
.otherwise({
redirectTo: '/'
});
Getting a clear answer to this question will help me understand how Angular really works with Express. Thank you in advance. This question also explains why I am confused with the stack but I tried to specify my confusion better in this question.