Web / Angular Interview questions
Types of LocationStrategy in Angular routes.
The router supports both styles with two LocationStrategy providers.
- PathLocationStrategy, the default "HTML5 pushState" style, a LocationStrategy used to configure the Location service to represent its state in the path of the browser's URL. The RouterModule.forRoot() function sets the LocationStrategy to the PathLocationStrategy, which makes it the default strategy.
- HashLocationStrategy, the "hash URL" style, a LocationStrategy used to configure the Location service to represent its state in the hash fragment of the browser's URL.
More Related questions...