我在角度2中使用bootstrap datetimepicker
https://eonasdan.github.io/bootstrap-datetimepicker/
在我的模板中,我有:
<div class='input-group date datepicker'>
<input type='text' class="form-control" [(ngModel)]="date">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar" (click)="getCalendar()"></span>
</span>
{{date}}
</div>
Run Code Online (Sandbox Code Playgroud)
问题是当我通过点击选择日历上的日期时,它不会触发任何"更改"事件(换句话说,ngModel不会触发).如果我在文本框中输入,则{{date}}显示值加上我键入的文本.
如果用户单击选择器中的日期进行更改,如何检测文本框中的更改?
有谁知道在Angle 2应用中使用简单的日期选择器?
我似乎无法让jQuery用户界面日期选择器正常工作?
有谁知道一个容易实现的人。
我试过了html date,但是它不能在所有浏览器中使用。
我在html5和angular2中使用打字稿
我尝试安装此程序:http : //jankuri.com/components/angular2-datepicker
错误我得到以下错误:
我当前的index.html文件:
<!DOCTYPE html>
<html lang="en">
<head>
<title>test</title>
<base href="/"></base>
<meta charset="UTF-8">
<meta content="IE=edge, chrome=1" http-equiv="X-UA-Compatible"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" type="image/png" href="/favicon32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicon16.png" sizes="16x16">
<link rel="stylesheet" type="text/css" href="/css/animate.css" />
<link rel="stylesheet" type="text/css" href="/bootstraptheme.css" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" />
<link href='https://fonts.googleapis.com/css?family=Lato:400,100,100italic,300italic,300,400italic,700italic,900,700,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="node_modules/moment/moment.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> …Run Code Online (Sandbox Code Playgroud)