MCPcopy Index your code
hub / github.com/angular/angular-cli / getServerAsset

Method getServerAsset

packages/angular/ssr/src/assets.ts:29–36  ·  view source on GitHub ↗

* Retrieves the content of a server-side asset using its path. * * @param path - The path to the server asset within the manifest. * @returns The server asset associated with the provided path, as a `ServerAsset` object. * @throws Error - Throws an error if the asset does not exist.

(path: string)

Source from the content-addressed store, hash-verified

27 * @throws Error - Throws an error if the asset does not exist.
28 */
29 getServerAsset(path: string): ServerAsset {
30 const asset = this.manifest.assets[path];
31 if (!asset) {
32 throw new Error(`Server asset '${path}' does not exist.`);
33 }
34
35 return asset;
36 }
37
38 /**
39 * Checks if a specific server-side asset exists.

Callers 5

getIndexServerHtmlMethod · 0.95
assets_spec.tsFile · 0.80
constructorMethod · 0.80
handleServeMethod · 0.80
handleRenderingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected