简体   繁体   English

试图了解NGx-Bootstrap Datepicker组件

[英]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: 我不明白的是:

  • what #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.

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