There is couple of ways to do that one of them is as below...
I guess you have CSS code which shows your div
suppose your class name is .displayDiv that class only hit when your the URL is something.
http://localhost:3000/admin/questions/(questions:preview/5cb18f686560a2f98b43f8e0)
on component.ts file of QuestionPreviewComponent where you have to take variable like below...
pathName: any;
on
ngOnInit() {
this.pathName = location.pathname.split('/');
}
on HTML file of QuestionPreviewComponent
<div [ngClass]='pathName[2] === questions ? "displayDiv" : ""'>
------------------
------------------
Your code
-----------------
-----------------
</div>
You can leave else condition or add hide CSS if you prepare
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…