Reputation: 885
I am new to angular js and node js, i have some doubt ,can anyone explain why # occurs inbetween the url(localhost:3000/#/home)
Upvotes: 1
Views: 1354
Reputation: 5387
Those are called Hashbang URLs. Generally anything that us after Hash #, is not another URL but it still belongs to the same HTML page. With increasing JS libraries and increasing capabilities of web browsers, now we can replace URLs using HTML5 history API.
This hashbang technique is used as a fallback for older browsers, i.e., the whole application runs on a single HTML page and Angular watches for any # hash changes in the URL and triggers the appropriate route controller.
I suggest you to read more on hashbang URLs: Doing links like Twitter, Hash-Bang #! URL's
Upvotes: 2
Reputation: 3752
It is a way for older browsers to not do a full reload of the page when you navigate in your single page application in AngularJS.
It is called Hashbang and you can read more about it in the documentation:
https://docs.angularjs.org/guide/$location#hashbang-and-html5-modes
Upvotes: 3
Reputation: 698
#
in the URL segment denotes tag id used to automatically jump to that section in a long page. Now-a-days this is used by java-script frameworks like angular for virtual navigation purpose i.e., changing the part after #
does not cause a full page reload by the browser and used internally which div
element to show/hide in a SPA(Single Page Applications).
Upvotes: 3