JS: Flow through *ngFor loops

This commit is contained in:
Asger Feldthaus
2020-12-11 21:50:09 +00:00
parent 29dd8470d5
commit 1ab36dc81f
5 changed files with 87 additions and 6 deletions

View File

@@ -5,3 +5,11 @@
[prop4]="foo | testPipe:'safe'"
[prop5]="42 | testPipe:foo"
></other-component>
<div *ngFor="let element of taintedArray">
<other-component [prop1]="element"></other-component>
</div>
<div *ngFor="let element of safeArray">
<other-component [prop2]="element"></other-component>
</div>

View File

@@ -6,8 +6,12 @@ import { Component } from "@angular/core";
})
export class Foo {
foo: string;
taintedArray: string[];
safeArray: string[];
constructor() {
this.foo = source();
this.taintedArray = [...source()];
this.safeArray = ['a', 'b'];
}
}

View File

@@ -22,6 +22,7 @@ pipeClassRef
| TestPipe.ts:4:8:9:1 | class T ... ;\\n }\\n} | foo.component.html:5:20:5:27 | testPipe |
| TestPipe.ts:4:8:9:1 | class T ... ;\\n }\\n} | foo.component.html:6:19:6:26 | testPipe |
taintFlow
| foo.component.ts:11:20:11:27 | source() | other.component.ts:18:48:18:57 | this.prop1 |
| foo.component.ts:11:20:11:27 | source() | other.component.ts:21:48:21:57 | this.prop4 |
| foo.component.ts:11:20:11:27 | source() | other.component.ts:22:48:22:57 | this.prop5 |
| foo.component.ts:13:20:13:27 | source() | other.component.ts:18:48:18:57 | this.prop1 |
| foo.component.ts:13:20:13:27 | source() | other.component.ts:21:48:21:57 | this.prop4 |
| foo.component.ts:13:20:13:27 | source() | other.component.ts:22:48:22:57 | this.prop5 |
| foo.component.ts:14:33:14:40 | source() | other.component.ts:18:48:18:57 | this.prop1 |