1

I want to do the following:

i have a single program with 2 diffrent "layouts", one in localhost:3000 and one in localhost:3000/admin

In both i have diffrent css files rendered, both have diffrent template structure, but both! share the same js.

I want one ui-view to go to "home" page specifficaly to him, and the other one, for the sake of example, the admin one, to go do diffrent "home" page...

Something like this but unacomplished:

$stateProvider.
        state('home', {
            url: '/',
            templateUrl: 'modules/core/views/home.client.view.html'
        })
        .state('home', {
            url: '/admin/home',
            templateUrl: 'modules/core/views/admin/home.admin.client.view.html'
        });

Is it even possible? what is the best way to do this kind of thing...

totothegreat
  • 1,633
  • 4
  • 27
  • 59

1 Answers1

2

localhost:3000 and localhost:3000/admin are server routes, which you can find in app/ routes/core.server.routes.js Here is route

app.route('/').get(core.index);

You can add here your additional route and then in core controller add

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

};

This is backend way of making 2 pages which gives you double page app. If you want to keep your website single page app, you can achive this, making all this things in frontend(angular routes)

Mike
  • 447
  • 4
  • 15