angularangular2-templateangular-seed

Angular2: Providing routes with different / without template


I've an existing angular 2 (4.0.0) application on base of mgechev/angular-seed. The page uses the general template of app.component.ts which look like the following:

<sd-navbar></sd-navbar>
<router-outlet></router-outlet>
<footer></footer>

The current page is inserted with <router-outlet></router-outlet>. That's perfect for the current app.

Now we plan to provide routes in frontend that provide plain pages (pages without navbar and footer).

Is it possible to provide a page that use a different / no template?

Maybe it is possible to adjust the routingModule of subModules?!


Solution

  • You can simply set another router-outlet before this one.

    That way, your first outlet (the new one) will allow you to navigate through pages without anything, and eventually you will navigate to the second one that will have the navbar and the footer.