3

I want to use multiple server layout on meanjs framework, but the problem is how I can attach some angular front-end view page to specific server layout, I have a special login page that have a different server layout how I can fix this.

how can angular know what server layout must be loaded for which angular state.

I add an other action in core controller:

module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core.server.controller');
app.route('/').get(core.index);
app.route('/accounts/').get(core.login);
};
Anthon
  • 69,918
  • 32
  • 186
  • 246
fynx
  • 75
  • 4

1 Answers1

0

As of now, we couldn't able to create two layouts from server side. they need to update their core modules and routing techniques to resolve this problem.

I tried once and i couldn't complete the process, The idea is to change layout from server side routing and call layout render function in meanjs

Add additional code in core.server.routes.js

'use strict';

module.exports = function(app) {
    // Root routing
    var core = require('../../app/controllers/core.server.controller');
    app.route('/').get(core.index);
    app.route('/admin').get(core.admin);
};

Add aditional export function in core.server.controller.js

'use strict';

/**
 * Module dependencies.
 */
exports.index = function(req, res) {
    res.render('index', {
        user: req.user || null,
        request: req
    });
};

exports.admin = function(req, res) {
    res.render('admin', {
        user: req.user || null,
        request: req
    });
};

Add layouts in layout folder accordingly.This will help you create multiple layouts, but still there is a lot of routing problems will occour as i said above. If it is possible to fix it, this may work.

Thanks,

Prasanth P
  • 715
  • 2
  • 9
  • 24