bleenco / ng2-datepicker

Angular2 Datepicker Component
http://ng2-datepicker.jankuri.com
MIT License
310 stars 236 forks source link

I can't pass any options #144

Open VivienAdnot opened 7 years ago

VivienAdnot commented 7 years ago

Hello @jkuri

Thank you for your module it helps very much !! It's a great gift to the community

I'm encountering a small problem, it's probably me that doesn't know how to use your module properly.

I tried this:

<ng2-datepicker [options]="options" (outputEvents)="met($event)"></ng2-datepicker>

and in the component code:

export class MyComponent implements OnInit {
    options: DatePickerOptions;

    constructor() {
        this.options = { maxDate: new Date()};
    }

Sadly, it is ignored by your component and I don't see any working example in your doc. Can you help me please ?

Thank you again for your module it is great work !

nelaturuk commented 7 years ago

I am having the same issue.

matq007 commented 7 years ago

Try to define the options before constructor.

ashiksonic commented 7 years ago

This works for me,

options: any;

    constructor() {
        this.options = {
            minDate: new Date(),
            firstWeekdaySunday: true
        };
     }