如何在没有 bower 和 npm 的情况下安装 Angular Datetimepicker?

How to install Angular Datetimepicker without bower and npm?

我想在没有 bower 和 npm 的情况下使用 Angular Datetimepicker

我将 datetimepicker.js 加入我的 index.html

<link href="https://cdn.rawgit.com/zhaber/datetimepicker/master/datetimepicker.css" type="text/css" rel="stylesheet" >
<script src="https://cdn.rawgit.com/zhaber/datetimepicker/master/datetimepicker.js"></script>

我的app.js

var app = angular.module('myApp', [
    'ui.router',
    .....
    'datetimepicker',  // I try ui.bootstrap.datetimepicker and other names
]);

我也有视图和控制器,但现在它们是空的。

我收到错误:

Uncaught Error: [$injector:modulerr]

如何注入这个库?


加法 1:

并得到错误:

Uncaught Error: [$injector:modulerr]

鉴于此 plunkr linked in the GitHub repo 我认为您需要同时添加两者

angular.module('myApp', [...'ui.bootstrap', 'ui.bootstrap.datetimepicker']);