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

Function validateMetaDefinition

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

Source from the content-addressed store, hash-verified

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