I'm trying to retrieve a client side pdf file to display in the browser. Tried your normal href, path relative to the html file, and it doesn't work.
<a href="../assets/file.pdf>Get File</a>
And using routing doesn't work either, or I'm not using the right tag...
RouterModule.forRoot([
{ path:"resume", redirectTo: '../assets/file.pdf' },
{ path: '', component: AppComponent }
])
Not sure if Routing is the way to go either, I have only learned to route components based on their documentation.
<a href="..
should work. I think the problem is the path for your pdf file. Did you try <a href="/assets/file.pdf>
, instead of ../assets
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With