Skip to content

ng-model doesnt work if property is a true getter/setter property #32

@Torinth

Description

@Torinth

Hi, if on my controller I have a field called dateTime and I specify in ng-model to use vm.dateTime then everything works. If I use typescript to turn that dateTime into a getter/setter actual property with a backing field it no longer works and the setter never gets called

dateTime: Date
versus

private _dateTime: Date

get dateTime(): Date{
return this._dateTime;
}

set dateTime(value: Date): void {
this._dateTime = value;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions