Код: Выделить всё
< /code>
document-form.component.ts< /code> расширяет класс baseformcomponent, который имеет < /p>
@output () savechanged: eventemiter = new Eventemiter (); < /p>
< /blockquote>
и в одном (baseformconcomponer). PrettyPrint-Override ">private _saving;
get saving(){ return this._saving; }
//this is fired whenever needed.
set saving(value:boolean){
this._saving=value;
this.saveChanged.emit(value);
}
< /code>
In document-browser.component.tsКод: Выделить всё
onSaveChanged(state: boolean){
console.log("onSaveChanged fired");
this.isSaving=state;
}
< /code>
The problem is that the onSaveChanged never gets fired.
I've implemented the exact same code in a slightly different scenario in document-page.component.html and the event fires as expected:
xxxxx
< /code>
document-page.component.tsonSaveChanged(state:boolean){
this.isSaving=state;
}
< /code>
The document-form.component.ts is the same in both cases.
I've also attached a debugger and the setter is hit in both cases.
I am entirely new in Angular, so please help me understand why the method onSaveChanged is not fired in the first case.
Подробнее здесь: https://stackoverflow.com/questions/797 ... s-not-fire
Мобильная версия