fix(parse5): support comment nodes with getText and setText
In the browser, calling element.textContent causes child comment nodes to be ignored, while getting textContent directly on a comment node will return the comment. This change makes parse5Adapter consistent with this behavior by adding a 2nd argument to getText telling if it's being called recursively. Closes #5805
This commit is contained in:

committed by
Victor Savkin

parent
194dc7da78
commit
693d9dce5d
@ -1613,7 +1613,7 @@ export function main() {
|
||||
|
||||
it('should reflect property values on template comments',
|
||||
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
|
||||
var tpl = '<template [ng-if]="ctxBoolProp"></template>';
|
||||
var tpl = '<template [ngIf]="ctxBoolProp"></template>';
|
||||
tcb.overrideView(MyComp, new ViewMetadata({template: tpl, directives: [NgIf]}))
|
||||
|
||||
.createAsync(MyComp)
|
||||
|
@ -189,7 +189,7 @@ export function main() {
|
||||
it('should update any template comment property/attributes',
|
||||
inject([TestComponentBuilder, Renderer, AsyncTestCompleter],
|
||||
(tcb: TestComponentBuilder, renderer: Renderer, async) => {
|
||||
var tpl = '<template [ng-if]="ctxBoolProp"></template>';
|
||||
var tpl = '<template [ngIf]="ctxBoolProp"></template>';
|
||||
tcb.overrideView(MyComp, new ViewMetadata({template: tpl, directives: [NgIf]}))
|
||||
|
||||
.createAsync(MyComp)
|
||||
|
Reference in New Issue
Block a user