V
V
Vladislav2016-10-16 18:54:51
JavaScript
Vladislav, 2016-10-16 18:54:51

How to make 2 layouts in angular?

Used ui-router, $stateProvider.
There is a main one, on which there is a block with a ui-view
. So, now this ui-view, depending on the state, is replaced by either an authorization page or a registration page.
Question: how can I make another template to show other pages when the user is already logged in, since the template will be different from this one, which requires authorization and registration.
Also stick ui-view there and set up your state?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2016-10-16
@healqq

Well, you need to make 2 "sort of basic states".
those.

$stateProvider.state('base.authorized.%state_name%);
$stateProvider.state("base.unauthorized.%state_name%);

base.authorized and base.unauthorized will be your templates.
All other states are children of these states.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question