1
Input
とマークされた変数を動的に更新するこのアプリケーションがあります。私のTSにIonic 2 - 更新元の値の変更時の入力値
が、私はこのようなものを持っている:
@Component({
selector: 'page2',
templateUrl: 'page2.html',
inputs: ['currentTitle']
})
export class Page2 {
currentTitle: string;
constructor() {
console.log(currentTitle);
}
}
と親ページの私のHTMLで
: 今<page1 [example]="post.title"></page1>
私は、currentUsername
はコンストラクタでロードされないことを知っているが、デモ目的のためだけに。
私が望むのは、post.title
が変更された場合、currentTitle
はリロードするなどしなくても変更されます。
どうすればこの問題を解決できますか?