Angular routing – Fragment(Hash) URL in angular route - How to pass anchor as route parameter

preview_player
Показать описание
In this video, we are going to learn about Fragment URL in Angular Routing. Basically, we all are familiar with fragment routing or anchor routing in websites. Generally fragments are display URL with '#'. i.e.

In the above URL, We can see the part with # is fragment or anchor and it is nothing but a link which jumps to a content which contains the id mentioned in the fragment of Angular router.

In this video, I have explained how we can achieve same kind of fragment or anchor URL with Angular Routing. We just need to right few lines of code to achieve this.

Source Code:
===================================

Follow me on:
==================================

#visualstudiocode #typescript #angular #routing #angularrouting #fragmentrouting #angularurl #angular6 #angular7 #angular8 #angular9 #angular10 #angular11
Рекомендации по теме
Комментарии
Автор

Thank you so much! This video was helpful for me

fedes
Автор

This was a great tutorial, thank you! can you provide an example of this where the anchor/fragment is on a different page?

jonnywndrs
Автор

Thank you very much for this video. The explaination was clear and understandable. I wonder however, how you yould INSTANTLY jump to an anchor point. With the given solution a scroll effect would occur on larger sites.

ThomasTester-lqbu
Автор

Hey guy, how could i make this but my html is not on the same file, my app is using different modules.

thiagowerneck
Автор

I have a similar problem as @Hamza
Let's say you have Part1, Part2 and Part3 that appear on the same page on your site, but are not coded in the same component.

How do you do it?

nathanaelrayapin
Автор

hello i cant acces to a fragment on a new tab only on the same window i tried everything please how can i open new windows and acces to the frag

hamzabouzidi
Автор

It doesn't work if youa re hidding the anchor links. If you have a link that shows them, and then moves to the anchor. It doesn't to anything.

RoyerAdames