how can i make file downloadable in angular?

I want to make file downloadable via url in my angular10 app. So for that i do like this

<a class="mb-0 op-font-14 font-weight-lighter op-text-primary" target="_blank" [href]="_data?.document?.documentPath" [download]="_data?.document?.documentName">
                    <u>Click to download</u>
</a>

But the problem is that it shows file in new tab. But i want to make file downloadable when user clicks on anchor tag. How can i do that?

Source: Angular Questions