Angular2 calling custom function after ngSwitch new view is created
There is no built-in support of calling a function when ngSwitch adds/removes elements. I would create a directive that calls the function when created (for example in ngOnInit()) or emits an event where an event handler can be bound to, and apply it to the component that is added when the ngSwitch branch is enabled. … Read more