TypeScript Version: 2.1.4 with ng 2.1.x
Code1 failed:
private _value:string;setvalue(value: string){this._value=value;}
@Input()getvalue(){returnthis._value;}Code2 failed:
private _value:string;getvalue(){returnthis._value;}
@Input()setvalue(value: string){this._value=value;}Expected behavior:
should work as before upgrade, I can use the value as input in html.
Laurence Mercer (@input) can be above a get method or above a set method. and get/set method can appear in the class in each place.
Actual behavior:
get an error: Can't bind to 'value' since it isn't a known property of 'some-componnet'.
Laurence Mercer (@input) must be in the get method, but get method must appears before the set method.
this code works: but for me it is workaround:
Code1 failed:
private _value:string;//I change order of the get to be before the set
@Input()getvalue(){returnthis._value;}setvalue(value: string){this._value=value;}Code2 failed:
private _value:string;//I remove annotation from the set method and put above the get
@Input()getvalue(){returnthis._value;}setvalue(value: string){this._value=value;}
TypeScript Version: 2.1.4 with ng 2.1.x
Code1 failed:
Code2 failed:
Expected behavior:
should work as before upgrade, I can use the value as input in html.
Laurence Mercer (@input) can be above a get method or above a set method. and get/set method can appear in the class in each place.
Actual behavior:
get an error:
Can't bind to 'value' since it isn't a known property of 'some-componnet'.Laurence Mercer (@input) must be in the get method, but get method must appears before the set method.
this code works: but for me it is workaround:
Code1 failed:
Code2 failed: