Routes - Angular 2

1

I'll use an example of an admin panel.

In angle 1 I had $stateProvider.state() that inside it I could configure an internal name and the url that would be accessed, so I would have, for example:

.state('template', {
    url: '',
    abstract: true,
    views: {
        'main': {
            templateUrl: 'template/layout.html'
        }
    }
})
.state('template.Parceiro', {
    url: '/Parceiro',
    views: {
        'content': {
            templateUrl: MakeUrl('view/Parceiro/index.html'),
            controller: 'ParceiroController as vm'                        
        }
    }
})
So I have a default template that will be loaded inside the 'main' tag when I access # / Partner ... Firstly I'll load the 'template' path that you can have in my menu, footer etc and inside this 'template' I have a 'content' tag that will load the actual contents of my '/ Partner' request.

Why this? For when I access the / Login which is:

.state('Login', {
    ​url: '/Login',
    ​views: {
        ​'main': {
            ​templateUrl: MakeUrl('view/Login/index.html'),
            ​controller: 'LoginController as vm',
        ​}
​    }
​})

It will load the login page into the 'main' tag which has only one form in place of all my previously loaded template, so there will be no menu, footer, which is part of my panel layout. admin Then when I log in it will redirect to / Partner that will load template again in place of the 'main' tag and then the content of the / Partner request in the 'content' tag.

How do I do this, just with angle 2?

Thank you.

(Login Screen)

(Partneradminscreen)

    
asked by anonymous 27.03.2017 / 20:57

0 answers