2016-06-26 5 views
-1

Я использую самозагрузки timepicker в моем угловом JS приложения, где я использовал маршруты (ngRoute)Ошибка: узел не определен самозагрузка timepicker

В одной странице я использую самозагрузки timepicker и она отлично работает без каких-либо ошибок. Но то же самое, когда я использую всплывающее окно (ui-bootstrap), я получаю следующую ошибку.

Error: node is undefined 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8462:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8339:30 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8677:16 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8476:16 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:9206:20 
[email protected]://localhost:7084/Scripts/lib/bootstrap/ui-bootstrap-tpls.js:3678:9 
bind/<@http://localhost:7084/Scripts/lib/angular/angular.js:1266:15 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:9757:9 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:9156:11 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8459:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:9151:24 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:8459:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:9151:24 
compileTemplateUrl/<@http://localhost:7084/Scripts/lib/angular/angular.js:9496:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:16104:28 
scheduleProcessQueue/<@http://localhost:7084/Scripts/lib/angular/angular.js:16120:27 
$RootScopeProvider/this.$get</[email protected]://localhost:7084/Scripts/lib/angular/angular.js:17378:16 
$RootScopeProvider/this.$get</[email protected]://localhost:7084/Scripts/lib/angular/angular.js:17191:15 
$RootScopeProvider/this.$get</[email protected]://localhost:7084/Scripts/lib/angular/angular.js:17486:13 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:11637:36 
[email protected]://localhost:7084/Scripts/lib/angular/angular.js:11843:7 
[email protected]://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, но в консоли я вижу эту ошибку. Как это решить?

+0

Не могли бы вы указать, какой браузер вы используете? –

+0

Firefox. Даже в IE возникает одна и та же ошибка. присутствует в моем Layout.cshtml – Sanketh

ответ

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 });  
}); 
+0

Спасибо. Это сработало!. – Sanketh