eslam masoud eslam masoud -4 years ago 151
TypeScript Question

How to get value from link in angular

How can I get a value from link in angular 4, I have made *ngIf and I want it to show div based on the value of the link

<div *ngIf="get the value from the current href">

Answer Source
<div *ngIf="isHomePage()>

and in TS,

 isHomePage(): boolean {
        return this.router.url == 'yourcheckurl';
  }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download