I have a question here. It seems like "(ngModelChange)" binds with "onChange($event)", if I change it to other method like "doSomething($event)", it will throw an error.
<datepicker [(ngModel)]="dt" [minDate]="minDate"
[showWeeks]="false" (ngModelChange)="onChange($event)"></datepicker>
I try to find and change the original method in source code, but I cannot find.
Also, I saw there is a "toggleMode()" method for the top button ( select 'years' or 'months'), because I want to have event when I click the top button, however, these is nothing change even I change the moethod in source code.
Any hints for this?
Thanks
ng bootstrap version?
@valorkin Thanks for the quick reply!
My ng2-bootstrap version is 1.1.16, and angular 2.2.3.
try to update to 1.1.16-7
try to bind to onChange event of datepicker
or on selectionDone event
@valorkin Hi, I have updated to 1.1.16-7, but now it throws an error "No provider for DatepickerConfig" for the original program.
app.module.ts:
import { Ng2BootstrapModule } from 'ng2-bootstrap/ng2-bootstrap';
import { DatepickerModule } from 'ng2-bootstrap/ng2-bootstrap';
...
imports: [ BrowserModule,HttpModule,
ChartsModule, SelectModule,
Ng2BootstrapModule, DatepickerModule.forRoot()],
...
http://valorkin.github.io/ng2-bootstrap/#/datepicker
I am working on docs update
BTW replace 'ng2-bootstrap/ng2-bootstrap' with 'ng2-bootstrap'
it is strange, it should work
try to remove Ng2BootstrapModule from imports
@valorkin Yep, I just let them work again, and now I am try the onChnageand selectionDone methods.
Thanks @valorkin ,
the selectionDone method works, but I don't know how to use onChange .
Also I am trying to detect the date value when I am selecting month or year on the main datepicker panel, not just take the whole date when I click to the exact day. Does any method can do like that?
And also the top button (not on the main panel) for letting datapicker jump to monthpicker.component and yearpicker.component, are there any events are listening to it so that I can invoke them when I click on it?
not at the moment
I see. So how colud I add methods or get some there?
There was not thing happened even I added breakpoints or changed somewhere in source code.
unfortunately it is not so easy at the moment
can you update topic starter as a feature request?
So is it correct to change like that?
Yeah, I think the .ts files are simplifed after I download, so I tried to add break points in .js files, unfortunately it did not work.
Thanks for your guys hard working!
@XidongHuang thanks for kind words!
is this still relevant,
please check
new datepicker
available in v1.9.2
http://valor-software.com/ngx-bootstrap/#/datepicker
if it still relevant please drop me a note