[英]Mean.js Multiple Layouts, Server or Angular Layout
我一直在开发一个mean.js应用程序。 我有一个管理主题,我正在尝试与现有的应用程序集成。
我的问题是
假设我有一个Index.html文件,如果预期路由是Dashboard,我只是替换页面视图的一部分,(Ruby on Rails Developers会知道这个)
更新1 :我用我需要的管理员索引和布局文件创建了2个文件。
admin.index.server.view.html
和
admin.layout.server.view.html
我还在core.server.routes.js中添加了以下代码
module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core');
app.route('/').get(core.index);
app.route('/admin/').get(core.adminIndex);
};
我还在core.server.controller.js中添加了以下代码
exports.adminIndex = function(req, res) {
res.render('admin.index', {
user: req.user || null
});
};
当我点击localhost:3000 / admin /我得到错误:找不到模块'索引'
将admin.index.server.view.html
和admin.layout.server.view.html
的两个视图文件分别重命名为admin-index.server.view.html
和admin-index.server.view.html
。
另外,在core.server.controller.js
文件中更改此行; res.render('admin.index', {
对此; res.render('admin-index', {
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.