3

I have a application that animates on route change. But, I don't want to animate on certain paths. I only want animation to trigger when the route path is NOT '/' Tried this and have been searching for a solution online but i can't find any:

<main class="col-12 pt-5" [@routeAnimation]="o.isActivated ? o.activatedRoute.url !== '/' ? o.activatedRoute : '' : ''">
    <router-outlet #o="outlet"></router-outlet>
</main>

Is there anyone who have had a similar problem?

ClydeFrog
  • 912
  • 1
  • 14
  • 38
  • 2
    What about using empty transitions on this particular route ? `transition('/ <=> *', ...)` –  Aug 14 '18 at 06:50
  • @trichetriche I get compiler error when doing that: `ERROR in src/app/animations/animations.component.ts(149,17): error TS2538: Type 'AnimationStyleMetadata' cannot be used as an index type.` – ClydeFrog Aug 14 '18 at 07:02
  • Well I was talking about the idea, not the code, I've never done that. Find the correct syntax for that, or even mock a non-animated animation ! –  Aug 14 '18 at 07:04

0 Answers0