Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

Cannot read property 'datepicker' of undefined #216

Open
suchetaswabhav opened this issue May 8, 2018 · 0 comments
Open

Cannot read property 'datepicker' of undefined #216

suchetaswabhav opened this issue May 8, 2018 · 0 comments

Comments

@suchetaswabhav
Copy link

Hi,

I am trying to use this date time picker with the followign

**imports **

import { NKDatetimeModule } from 'ng2-datetime/ng2-datetime';
import 'jquery';
import * as $ from 'jquery'
import '@angular/platform-browser-dynamic';
import '@angular/platform-browser';
import 'rxjs';
import '@angular/common';
import 'bootstrap/dist/css/bootstrap.css';
import 'jquery/dist/jquery.min.js';
import 'bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css';
import 'bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js';
import 'bootstrap-timepicker/css/bootstrap-timepicker.min.css';
import 'bootstrap-timepicker/js/bootstrap-timepicker.js';

component.ts

date2: Date = new Date(2016, 5, 10);
datepickerOpts = {
startDate: new Date(2016, 5, 10),
autoclose: true,
todayBtn: 'linked',
todayHighlight: true,
assumeNearbyYear: true,
format: 'D, d MM yyyy'
}

component.html

<datetime [(ngModel)]="date">

ERROR

ERROR TypeError: Cannot read property 'datepicker' of undefined
at NKDatetime.showDatepicker (ng2-datetime.ts:168)
at Object.eval [as handleEvent] (NKDatetime.html:13)
at handleEvent (core.es5.js:11997)
at callWithDebugContext (core.es5.js:13458)
at Object.debugHandleEvent [as handleEvent] (core.es5.js:13046)
at dispatchEvent (core.es5.js:8601)
at eval (core.es5.js:9212)
at HTMLDivElement.eval (platform-browser.es5.js:2651)
at ZoneDelegate.invokeTask (zone.js:424)
at Object.onInvokeTask (core.es5.js:3881)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant