'How can we use external link in href of tag without the using base URL?

How can we use external link in href of <a> tag without base URL in Angular ? I found the [attr.href] for this problem. It works for like this links :www.example.com.

But when I added https://www.example.com or http://www.example.com then the link it doesn't work. New link is showing as :http://https//www.google.com. Do you have any idea ?

in .ts file ; exampleUrl:string='https://www.google.com';

<div>
        <a 
        [attr.href]="'//'+exampleUrl"
         target="_blank">
            {{ exampleUrl }}
        </a>
</div>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source