feat(ivy): add ng-reflect debug text for containers (#27350)
PR Close #27350
This commit is contained in:

committed by
Igor Minar

parent
20cef5078d
commit
1279a503a1
@ -273,16 +273,19 @@ export function toHtml<T>(componentOrElement: T | RElement, keepNgReflect = fals
|
||||
}
|
||||
|
||||
if (element) {
|
||||
let html = stringifyElement(element)
|
||||
.replace(/^<div host="">(.*)<\/div>$/, '$1')
|
||||
.replace(/^<div fixture="mark">(.*)<\/div>$/, '$1')
|
||||
.replace(/^<div host="mark">(.*)<\/div>$/, '$1')
|
||||
.replace(' style=""', '')
|
||||
.replace(/<!--container-->/g, '')
|
||||
.replace(/<!--ng-container-->/g, '');
|
||||
let html = stringifyElement(element);
|
||||
|
||||
if (!keepNgReflect) {
|
||||
html = html.replace(/\sng-reflect-\S*="[^"]*"/g, '');
|
||||
html = html.replace(/\sng-reflect-\S*="[^"]*"/g, '')
|
||||
.replace(/<!--bindings=\{(\W.*\W\s*)?\}-->/g, '');
|
||||
}
|
||||
|
||||
html = html.replace(/^<div host="">(.*)<\/div>$/, '$1')
|
||||
.replace(/^<div fixture="mark">(.*)<\/div>$/, '$1')
|
||||
.replace(/^<div host="mark">(.*)<\/div>$/, '$1')
|
||||
.replace(' style=""', '')
|
||||
.replace(/<!--container-->/g, '')
|
||||
.replace(/<!--ng-container-->/g, '');
|
||||
return html;
|
||||
} else {
|
||||
return '';
|
||||
|
Reference in New Issue
Block a user