MCPcopy Create free account
hub / github.com/angular/angular / validateMetaDefinition

Function validateMetaDefinition

packages/platform-browser/src/browser/meta.ts:188–199  ·  view source on GitHub ↗
(tag: MetaDefinition)

Source from the content-addressed store, hash-verified

186}
187
188function validateMetaDefinition(tag: MetaDefinition): void {
189 for (const prop of Object.keys(tag)) {
190 const attributeName = getMetaKeyMap(prop);
191 if (attributeName.toLowerCase().startsWith('on')) {
192 throw new RuntimeError(
193 RuntimeErrorCode.INVALID_EVENT_ATTRIBUTE,
194 (typeof ngDevMode === 'undefined' || ngDevMode) &&
195 `The Meta service does not allow setting event handler attribute '${attributeName}' for security reasons.`,
196 );
197 }
198 }
199}
200
201function parseSelector(tag: MetaDefinition): string {
202 const attr: string = tag.name ? 'name' : 'property';

Callers 2

updateTagMethod · 0.85
_getOrCreateElementMethod · 0.85

Calls 2

getMetaKeyMapFunction · 0.85
keysMethod · 0.65

Tested by

no test coverage detected