0

这是我的代码

<input
class="form-control"
ng-model="a.newTimes[$index]['time']._dateProxy"
ng-change="updateProviderComment(a)"
bs-timepicker
type="text">

a.newTimes[$index]['time']._dateProxy 是一个新的 Date() 对象

关键是:函数 updateProviderComment 仅第一次运行,何时更改时间错误?怎么修?

4

2 回答 2

0

@mautrok 是的,我完全同意你的看法——angular-ui 更好(也许只是现在)。但是关于项目中的设计,我们有带有 html 内容的弹出窗口,我不能用 angular-ui 来实现它。我尝试重新定义弹出框模板并在里面使用 ng-include ,如下所示:

angular.module("template/popover/popover.html", []).run(["$templateCache", function($templateCache){
    $templateCache.put("template/popover/popover.html", ""
        +"<div class=\"popover popover-appointment {{placement}}\" ng-class=\"{ in: isOpen(), fade: animation() }\">"
        +"<div class=\"arrow\"></div>"
        +"<div class=\"popover-inner\">"
        +"<h3 class=\"popover-title\" ng-bind=\"title\" ng-show=\"title\"></h3>"
        +"<div class=\"popover-content\" ng-controller=\"AppointmentPopoverController\" ng-include src=\"content\"></div>"
        +"</div>"
        +"</div>"
        +"");
}]);

它可以工作,但是当popover重新打开时javascript绑定消失了

于 2014-03-30T19:31:10.893 回答
0

我发现 angular strap 模块有很多问题,我可以建议您将 angular-ui 模块用于 timepicker 吗?我用这个模块在我的应用程序中做了类似于你的选择器的事情,一切正常。看看这里

于 2014-03-28T10:58:48.050 回答