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

Method on

packages/angular/ssr/src/hooks.ts:105–112  ·  view source on GitHub ↗

* Registers a new hook function under the specified hook name. * This function should be a function that takes an argument of type `T` and returns a `string` or `Promise `. * * @template Hook - The type of the hook name. It should be one of the keys of `HooksMapping`. * @param nam

(name: Hook, handler: HooksMapping[Hook])

Source from the content-addressed store, hash-verified

103 * ```
104 */
105 on<Hook extends HookName>(name: Hook, handler: HooksMapping[Hook]): void {
106 const hooks = this.store.get(name);
107 if (hooks) {
108 hooks.push(handler);
109 } else {
110 this.store.set(name, [handler]);
111 }
112 }
113
114 /**
115 * Checks if there are any hooks registered under the specified name.

Callers 15

executeFunction · 0.80
executor.tsFile · 0.80
_fetchMethod · 0.80
watchMethod · 0.80
watchMethod · 0.80
initFunction · 0.80
configureI18nBuildFunction · 0.80
goToPageAndWaitForWSFunction · 0.80
hmr_spec.tsFile · 0.80
getAvailablePortFunction · 0.80
spawnAsObservableFunction · 0.80

Calls 3

getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected