[英]Trying to understand NGx-Bootstrap datepicker component
I'm having some trouble understanding the docs for the date picker component. 我在理解日期选择器组件的文档时遇到了一些麻烦。
Date Picker Documentation 日期选择器文档
What I understand: 我的理解:
[(bsValue)]
should be set to the variable on the controller that I want to fill with a Date object [(bsValue)]
应该设置为我要用Date对象填充的控制器上的变量 bsDatepicker
is the directive that makes it a date picker bsDatepicker
是使其成为日期选择器的指令 What I don't understand: 我不明白的是:
#dp=bsDatepicker
is for/does #dp=bsDatepicker
适用于/做什么 (click)=dp.toggle()
throws an error about the property toggle of undefined being called, but it does work! (click)=dp.toggle()
引发有关未定义的属性切换被调用的错误,但确实可以! I do understand that the spec for this isn't final, but what are these properties and what are they supposed to do? 我确实知道这不是最终的规范,但是这些属性是什么,它们应该做什么?
#dp=bsDatepicker
is to set a template variable dp
to the directive bsDatepicker
. #dp=bsDatepicker
用于将模板变量dp
设置为指令bsDatepicker
。 It basically gives the db
variable reference to bsDatePicker
type so it has access to bsDatePicker
methods and stuffs. 它基本上为
db
变量提供了对bsDatePicker
类型的引用,因此可以访问bsDatePicker
方法和内容。 Then on button (click)
event, you assign dp.toggle()
so that the button will toggle the DatePicker. 然后在按钮
(click)
事件上,分配dp.toggle()
以便按钮将切换DatePicker。 I hope I am making sense. 我希望我有道理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.