What are those events called in Angular 2 when radio button is selected or unselected.
Something like
So when I click one radio button in a group, it will fire selected() for the new selection and unselected() for the previous selection.
解决方案
It works,
But you need code more to judge 'selected' or 'unselected'.
You may try this in your *.ts file:
export class Comp {
private _prevSelected: any;
handleChange(evt) {
var target = evt.target;
if (target.checked) {
doSelected(target);
this._prevSelected = target;
} else {
doUnSelected(this._prevSelected)
}
}
}