kekeh / angular-mydatepicker

Angular datepicker and date range picker :date:
https://kekeh.github.io/angular-mydatepicker/
MIT License
1 stars 11 forks source link

Can't bind [options] and no directive for angular-mydatepicker #1

Closed ryanbuening closed 5 years ago

ryanbuening commented 5 years ago

I added AngularMyDatePickerModule.forRoot() to my imports but I'm getting the following errors below in my html template. I'm using Angular 7.1.2

image

image

kekeh commented 5 years ago

Check that you have imported needed modules in your app module. Here is working example: https://github.com/kekeh/angular-mydatepicker/blob/master/example/app/app.module.ts

ryanbuening commented 5 years ago

I double checked and I appear to be importing the necessary things into my app.module.ts. I'm using the FormsModule.

I am switching from the old ngx-mydatepicker to this new library. Not sure if that is causing some kind of issue? I did npm uninstall ngx-mydatepicker before installing this new library though.

ryanbuening commented 5 years ago

I created a new project and reproduced the same issue:

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AngularMyDatePickerModule } from 'angular-mydatepicker';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        AppRoutingModule,
        FormsModule,
        AngularMyDatePickerModule.forRoot()
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html

image

am I not importing something correctly? Do I need to import something into app.component.ts?

kekeh commented 5 years ago

I have used angular 7.2.0 in this new component. You have older version.

You can follow instructions from readme file.

ryanbuening commented 5 years ago

I created my new project and used Angular 7.2.0 and still had the same issue. Sounds like it is just me though. I'll just continue to use ngx-mydatepicker. Closing.