Angularjs Angular 2模型属性未从剑道UI日期选择器拾取更新的日期值
我正在编写一个angular应用程序,其中我希望根据剑道日期选择器的更新值调用API。剑道日期选择器绑定到角度模型,但是,更改日期后,我在模型变量中得到相同的旧值(最初指定的值)。下面是我正在使用的Typescript和HTML代码。我遗漏了什么吗 HTML:Angularjs Angular 2模型属性未从剑道UI日期选择器拾取更新的日期值,angularjs,typescript,kendo-datepicker,Angularjs,Typescript,Kendo Datepicker,我正在编写一个angular应用程序,其中我希望根据剑道日期选择器的更新值调用API。剑道日期选择器绑定到角度模型,但是,更改日期后,我在模型变量中得到相同的旧值(最初指定的值)。下面是我正在使用的Typescript和HTML代码。我遗漏了什么吗 HTML: <input id="datepicker" kendo-datepicker k-ng-model="StartDate" value="{{StartDate}}" /> <button type="butto
<input id="datepicker" kendo-datepicker k-ng-model="StartDate" value="{{StartDate}}" />
<button type="button" class="btn btn-primary" (click)="save();">Save</button>
export class AdminPeriodConfigurationComponent {
StartDate: any;
constructor(private _router: Router, private _globalService: GlobalService){
}
loadData(){
this.StartDate="09/28/2016";// format is "mm-dd-yyyy" and this value binds to datepicker
}
ngOnInit() {
this.loadData();
}
save(){
var myobj=new MyClass();
myobj.NewSelectedDate=this.StartDate; // here the updated value does not get assigned.
}
}