0

I'm laying out an Angular app that's got a totally different style for the landing page then the rest of the application. I've styled some internal "pages" but need to add in additional divs, classes, use a different footer, etc.

I've been digging through looking for the best way to do this and I can't find a consistent answer. I thought I could create conditions based off the route, but I keep getting template errors. Any help is greatly appreciated. Thanks in advance!

a_trish
  • 9
  • 2
  • is this is a option? https://stackoverflow.com/questions/46770046/how-to-best-conditional-template-show-in-angular-4 – Matheus Barem Sep 26 '18 at 20:53
  • Unfortunately it's not. I should have been more clear. There are sign up pages before a user is logged in -- so the isUser flag won't work in this case. But thanks for the input! – a_trish Sep 26 '18 at 20:56
  • The landing page have a relation with the application(save data or anything)? if not, you can isolate te code of landing page from de application. – Matheus Barem Sep 26 '18 at 21:04

1 Answers1

0

So I found a work around for this issue, after all. In my main component that loads in my page elements I added in an event to look for the "landing page" url:

    this.router.events.subscribe(event => {

        if (this.router.routerState.snapshot.url === '/') {

        } else {

        }
    }); 

Then using *ngIf I passed in the values to show/hide which elements I wanted to load in my main component on my landing page vs. other pages.

a_trish
  • 9
  • 2