Skip to content

[Angular] Dealing with angular routing and initTE()? #2014

Closed Answered by nac0n
nac0n asked this question in Support from community
Discussion options

You must be logged in to vote

I made a component called te-initiator.component, which sole purpose is to provide the initTE({ Button, Ripple, Dropdown}); call, leaving out the allowReinits option, so that it doesn't initiate the call several times. I'm then extending this te-initiator.component to every child that needs the ES init.

This works i suppose, but it would rather feel better if the call is made once, even when dealing with angular routing.

Initiator:

export class TEInitiatorComponent implements OnInit {
  constructor() { }

  ngOnInit() {
    initTE({ Button, Ripple });
  }
}

Used in:

export class ButtonOutlineComponent extends TEInitiatorComponent {
  constructor() {}
}

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@juujisai
Comment options

@nac0n
Comment options

@juujisai
Comment options

@nac0n
Comment options

Answer selected by nac0n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants