pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://angular.dev/api/common/HashLocationStrategy

auto' && prefersDark)) { documentClassList.add(DARK_MODE_CLASS_NAME); } else { documentClassList.add(LIGHT_MODE_CLASS_NAME); } if (location.search.includes('uwu')) { documentClassList.add('uwu'); } HashLocationStrategy • Angular
    • Overview
@angular/common

HashLocationStrategy

Class
stable

A LocationStrategy used to configure the Location service to represent its state in the hash fragment of the browser's URL.

API

    
      class HashLocationStrategy extends LocationStrategy implements OnDestroy {}
    
    

constructor

HashLocationStrategy
@param_platformLocationPlatformLocation
@param_baseHrefstring | undefined

onPopState

void
@returnsvoid

getBaseHref

string
@returnsstring

path

string
@paramincludeHashboolean
@returnsstring

prepareExternalUrl

string
@paraminternalstring
@returnsstring

pushState

void
@paramstateany
@paramtitlestring
@parampathstring
@paramqueryParamsstring
@returnsvoid

replaceState

void
@paramstateany
@paramtitlestring
@parampathstring
@paramqueryParamsstring
@returnsvoid

forward

void
@returnsvoid

back

void
@returnsvoid

getState

unknown
@returnsunknown

historyGo

void
@paramrelativePositionnumber
@returnsvoid

Description

A LocationStrategy used to configure the Location service to represent its state in the hash fragment of the browser's URL.

For instance, if you call location.go('/foo'), the browser's URL will become example.com#/foo.

Usage Notes

Example

import {HashLocationStrategy, Location, LocationStrategy} from '@angular/common';
import {Component} from '@angular/core';

@Component({
  selector: 'hash-location',
  providers: [Location, {provide: LocationStrategy, useClass: HashLocationStrategy}],
  template: `
    <h1>HashLocationStrategy</h1>
    Current URL is: <code>{{ location.path() }}</code
    ><br />
    Normalize: <code>/foo/bar/</code> is: <code>{{ location.normalize('foo/bar') }}</code
    ><br />
  `,
  standalone: false,
})
export class HashLocationComponent {
  location: Location;
  constructor(location: Location) {
    this.location = location;
  }
}
Jump to details
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy