I've an Angular 5 project created using @angular/cli, when running the application in development mode, when I click on a tab that shows me a component, I receive this message in the chrome console
[Violation] 'click' handler took 289ms
Your question is pretty wierd, i understand this. You need a button that allow you to show or not a component. If that's your answer, is pretty simple. In your FileNamecomponent.ts set a boolean variable
public showComponent:boolean = false;
Then in your FileNamecomponent.html use button tag to call an event that toggle your flag, and an *ngIf instance to show your component.
<button type="button" (click)="showComponent = !showComponent"></button>
<div *ngIf="showComponent">
<app-OtheComponentName></app-OtherComponentName>
</div>
-app-OtherComponentName - It mean the selector of your component, you will find in @Component decorator
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
});
I hope this is will be helpfully.