Set href string in angular 8 given by server

13 Views Asked by At

I have this in my html:

<a href="{{cookie_policy_url}}" target="_blank" class="primary">

where cookie_policy_url is a string that is initially blank and that I get from the server, this way:

 this.navService.getUrlCookiePolicy().subscribe(s => {
      this.cookie_policy_url = s;
      this.changeDetector.detectChanges();
    });

The string I receive is correct, but for some reasons it doesn't update the href url, so when I click it it is empty. What is the correct way to use this?

0

There are 0 best solutions below