错误:节点未定义bootstrap timepicker

时间:2016-06-26 06:53:59

标签: angularjs twitter-bootstrap timepicker modalpopup

我在我使用路线的角度js应用程序中使用bootstrap timepicker(ngRoute)

在一个页面中,我使用的是bootstrap timepicker,它运行正常,没有任何错误。但是当我在弹出窗口中使用时(ui-bootstrap),我收到以下错误。

Error: node is undefined
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8462:13
publicLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8339:30
lazyCompilation@http://localhost:7084/Scripts/lib/angular/angular.js:8677:16
boundTranscludeFn@http://localhost:7084/Scripts/lib/angular/angular.js:8476:16
controllersBoundTransclude@http://localhost:7084/Scripts/lib/angular/angular.js:9206:20
.link@http://localhost:7084/Scripts/lib/bootstrap/ui-bootstrap-tpls.js:3678:9
bind/<@http://localhost:7084/Scripts/lib/angular/angular.js:1266:15
invokeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:9757:9
nodeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:9156:11
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8459:13
nodeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:9151:24
compositeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:8459:13
nodeLinkFn@http://localhost:7084/Scripts/lib/angular/angular.js:9151:24
compileTemplateUrl/<@http://localhost:7084/Scripts/lib/angular/angular.js:9496:13
processQueue@http://localhost:7084/Scripts/lib/angular/angular.js:16104:28
scheduleProcessQueue/<@http://localhost:7084/Scripts/lib/angular/angular.js:16120:27
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:7084/Scripts/lib/angular/angular.js:17378:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:7084/Scripts/lib/angular/angular.js:17191:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:7084/Scripts/lib/angular/angular.js:17486:13
done@http://localhost:7084/Scripts/lib/angular/angular.js:11637:36
completeRequest@http://localhost:7084/Scripts/lib/angular/angular.js:11843:7
requestLoaded@http://localhost:7084/Scripts/lib/angular/angular.js:11776:9
<div class="modal-content" uib-modal-transclude="">

cshtml

<div class="bootstrap-timepicker">
  <div class="form-group">
    <div class="input-group">
      <input type="text" id="txtTime" class="form-control timepicker">
      <div class="input-group-addon">
        <i class="fa fa-clock-o"></i> 
      </div>
    </div>
  </div>
</div>

的javascript

 $(function () {
    $(".timepicker").timepicker({ showInputs: false });       
});

模态弹出式代码

$uibModal.open({    
animation: true,
templateUrl: /Controller/Action,
controllerAs: somename,
controller: somecontroller,
backdrop: static,
keyboard: true,
size: null

});

timepicker在thr poup中工作但在控制台中我看到了这个错误。 我该如何解决?

1 个答案:

答案 0 :(得分:0)

试试这个:

<div class="input-group bootstrap-timepicker timepicker">
            <input id="timepicker1" type="text" class="form-control input-small">
            <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
        </div>

javascript

 $(function () {
$("#timepicker1").timepicker({ showInputs: false });       
 });