0
export class Test {
a1: number;
name: string;
}
@Component({
selector: '[t1-info]',
templateUrl: './t1component.html',
})
export class T1InfoComponent implements OnInit {
@Input() test: Test;
constructor() { }
ngOnInit() {
}
}
<div t1-info [test]="test"></div>
<button (click)='test.a1 = test.a1-1'>test</button>
またはangular2 @Input()時計を変更しますか?
test.a1変更を監視する方法http.get(....).subscribe(res=>{
test.a1=1;
})
? angular1 $ウォッチと同様に
自動比較できません。プログラムでイベントをトリガーしますか? – neo
あなたは何を言っているのですか? –