简体   繁体   中英

How to install Angular Datetimepicker without bower and npm?

I want to use Angular Datetimepicker without bower and npm.

I include datetimepicker.js into my 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>

My app.js

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

Also I have view and controller but now they are empty.

I get error:

Uncaught Error: [$injector:modulerr]

How to inject this library?


Addition 1:

在此处输入图片说明

And get error:

Uncaught Error: [$injector:modulerr]

鉴于在GitHub 存储库中链接了这个plunkr ,我认为您需要同时添加两者

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM