我正在尝试按照AngularDart 入门指南上的说明在我的项目中使用 AngularStrap datepicker 功能很好,但外观不正常。即使没有加载我自己的样式表,外观也不应该是这样。这两个屏幕截图应该可以澄清这个问题:
它应该看起来如何:
它的实际外观:
该应用程序是用 yeoman.io 搭建的
bower.json 配置:
{
"name": "myapp",
"version": "0.0.0",
"dependencies": {
"angular": "~1.2.14",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.10.2",
"bootstrap": "~3.1.0",
"angular-resource": "1.2.14",
"angular-cookies": "1.2.14",
"angular-sanitize": "1.2.14",
"angular-route": "1.2.14",
"moment": "~2.5.1",
"angular-strap": "~2.0.0",
"angular-motion": "~0.3.2",
"angular-animate": "~1.2.14"
},
"devDependencies": {
"angular-mocks": "1.2.14",
"angular-scenario": "1.2.14"
},
"resolutions": {
"angular": "1.2.14"
}
}
相关的 index.html 片段:
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="bower_components/angular-motion/dist/angular-motion.min.css" />
...
<link rel="stylesheet" href="styles/style.css"/>
....
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.min.js"></script>
<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.min.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.tpl.min.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
html中的datepicker输入标签:
<input type="text" class="form-control" ng-model="selectedDate" name="date" data-date-format="dd-MM-yyyy" data-start-view="2" bs-datepicker>