0
@Input()
デコレータをコンポーネントプロパティに適用してから、カスタムデコレータとチェーンします。PropertyDecorator内からコンポーネントのプロパティを読み取る
私のパブリックプロパティは、正しくバインドされていても読み込み/設定できないようです。この時点で私のコンポーネントのプロパティの読み取り/書き込みする方法
例えば 私の言語のデコレータで次に@Input()
@Language('global.pw.current')
public existingPasswordLabel: string;
export function Language(keyId: string): PropertyDecorator {
return (target: any, key: string) => {
setTimeout(()=>{
console.log(target[key]); //This is never set but is on screen
// in fact none of my public component properties are on the target
},1000); //Plenty of delay to make sure binding has happened
};
}
。
@inputデコレータの実装は、オブジェクトのsetとget paramsをオーバーライドしていると思います。 – DmitriyKhirniy