Make anchor links refer to the current page when using <base>

后端 未结 12 1182
情书的邮戳
情书的邮戳 2020-11-30 03:29

When I use the html tag to define a base URL for all relative links on a page, anchor links also refer directly to the base URL. Is there a way to

12条回答
  •  时光说笑
    2020-11-30 04:15

    If you're using Angular 2+ (and just targeting the web) you can do this:

    component.ts

    document = document; // Make document available in template
    

    component.html

    Click Here
    

提交回复
热议问题