docs/en/framework/ui/angular/cross-origin-strategy.md
//[doc-seo]
{
"Description": "Learn how to use the `CrossOriginStrategy` class in the @abp/ng.core package to manage resource retrieval in your applications effectively."
}
CrossOriginStrategy is a class exposed by @abp/ng.core package. Its instances define how a source referenced by an element will be retrieved by the browser and are consumed by other classes such as LoadingStrategy.
constructor(
public crossorigin: 'anonymous' | 'use-credentials',
public integrity?: string
)
crossorigin is mapped to the HTML attribute with the same name.integrity is a hash for validating a remote resource. Its use is explained here.setCrossOrigin(element: HTMLElement): void
This method maps the aforementioned properties to the given element.
Predefined cross-origin strategies are accessible via CROSS_ORIGIN_STRATEGY constant.
CROSS_ORIGIN_STRATEGY.Anonymous(integrity?: string)
crossorigin will be set as "anonymous" and integrity is optional.
CROSS_ORIGIN_STRATEGY.UseCredentials(integrity?: string)
crossorigin will be set as "use-credentials" and integrity is optional.