以下是我要在我的应用程序中运行的代码。即使我有相同版本的js和css。这里是plunker链接。 demo原始代码,此处。
//html code
<div ng-controller="DatepickerDemoCtrl">
<h4>Popup</h4>
<div class="row">
<div class="col-md-6">
<p class="input-group">
<input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="dt" is-open="opened" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
</div>
</div>
//Js code
var DatepickerDemoCtrl = function ($scope) {
$scope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened = true;
};
};
这个代码在我的控制器中应用完全相同,我也包含了依赖模块,我有与plunker相同的版本。但是在我的申请中没有用。我从最近2天开始挣扎。请有人让我知道原因 这是我的HTML
<h4>Popup</h4>
<div class="row">
<div class="col-md-6">
<p class="input-group">
<input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="dt" is-open="opened" />hi{{dt}}
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="opencal($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
</div>
....//my ctrl is home ctrl here so this code wrapped in homectl.
这是我的js代码
//app code.
var app1 = angular.module("HomeApp",['uiSlider','ui.bootstrap']);
//this where i defined dependency.
app1.controller('HomeCtrl', function( $scope,$http,$q,$location,$window,$routeParams,$modal, $log) {
//here is my datepicker code.
$scope.opencal = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened = true;
};
...//my rest code goes below
我的查询是