MCPcopy Index your code
hub / github.com/angular/angular / toHtml

Function toHtml

packages/core/test/render3/view_fixture.ts:246–267  ·  view source on GitHub ↗
(element: Element, keepNgReflect = false)

Source from the content-addressed store, hash-verified

244}
245
246function toHtml(element: Element, keepNgReflect = false): string {
247 if (element) {
248 let html = stringifyElement(element);
249
250 if (!keepNgReflect) {
251 html = html
252 .replace(/\sng-reflect-\S*="[^"]*"/g, '')
253 .replace(/<!--bindings=\{(\W.*\W\s*)?\}-->/g, '');
254 }
255
256 html = html
257 .replace(/^<div host="">(.*)<\/div>$/, '$1')
258 .replace(/^<div fixture="mark">(.*)<\/div>$/, '$1')
259 .replace(/^<div host="mark">(.*)<\/div>$/, '$1')
260 .replace(' style=""', '')
261 .replace(/<!--container-->/g, '')
262 .replace(/<!--ng-container-->/g, '');
263 return html;
264 } else {
265 return '';
266 }
267}

Callers 1

htmlMethod · 0.70

Calls 2

stringifyElementFunction · 0.90
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…