I have the following code that runs a function whenever the user changes the value of the wj-input-time
:
@Component({
selector: 'my-app',
template: '<wj-input-time [step]="1" (valueChanged)="test()"></wj-input-time>'
})
export class AppComponent {
test() {
console.log('test');
}
}
The above works fine but when I add data binding to the input the valueChanged
event is fired when the app loads and also when the user simply clicks the input which is not the desired outcome:
@Component({
selector: 'my-app',
template: '<wj-input-time [(value)]="testDate" [step]="1" (valueChanged)="test()"></wj-input-time>'
})
export class AppComponent {
testDate: Date = new Date();
test() {
console.log('test');
}
}
I have spent a lot of time reading Wijmo’s documentation but it was not helpful. What am I missing or doing wrong?
I’m using Angular 2 final and Wijmo 5.20162.211 eval
Here’s a Plunker that shows the issue (check the console log): http://plnkr.co/edit/RFo84NEUbypSWwPPu8Go?p=preview