angularjs引导数据采集器未更新模型
我正在尝试在我自己的angular控制器中使用angular ui的引导日期选择器angularjs引导数据采集器未更新模型,angularjs,twitter-bootstrap,datepicker,Angularjs,Twitter Bootstrap,Datepicker,我正在尝试在我自己的angular控制器中使用angular ui的引导日期选择器 <input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened" ng-required="true" close-text="Chiudi" /> <span class="input-group-btn">
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
当所有库更新到最新版本时,我有一个奇怪的问题:从控制器读取初始值,显示日期选择器,选择日期并更新文本框,但在此之后控制器中的值变为未定义。我错过了什么?什么会导致这种行为
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
谢谢,
卢卡·莫雷利
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
这是视图的内容,定义了两个日期的范围
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
使用batarang,我看到选择第一个日期,当弹出窗口关闭时,模型不会更新,当我打开第二个弹出窗口时,模块会更新,显示未定义的DTNizio
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
调试更多我发现:我设置了一个断点来评估状态,我看到值是2014年9月16日星期二00:00:00 GMT+0200(欧盟西部…
这是正确的,但下面我发现
协议:无效日期
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
这意味着什么?尝试以下操作:将
$scope.dtFine=moment().format(“DD/MM/YYYY”);
初始化更改为$scope.dt={fine:moment().format(“DD/MM/yyyyy”);
然后在HTML上将ng model=“dtFine”
更改为ng model=“dt.fine”
。我刚刚发现这个:调试更多我发现这个:我设置了一个断点来评估状态,我看到值是2014年9月16日星期二00:00:00 GMT+0200(W.Eu…这是正确的,但下面我发现proto:Invalid Date
<input type="text" class="form-control" datepicker-popup="{{dtFormat}}" ng-model="dtFine" is-open="dtFineOpened"
ng-required="true" close-text="Chiudi" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openDtFine($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>