date-time-picker: Only on production environment the input click generates an error

Everything on development works just the way it should. On the click event the calendar is shown and enables me to pick a date. When serving on production mode with angular-cli, with ng serve --prod, clicking on the input throws an error in the console that looks like the one in the attachment.

<input mdInput class="picker-input" [ngModel]="transactionForm.date | date: 'short'" required="true" [(dateTimePicker)]="transactionForm.date" placeholder="Date" dividerColor="none" readonly [theme]="'green'" [locale]="'ro'">

So here is the console error that I receive: selection_010

I can see that is something related to AOT and the fact that the dialog creation is created in a dynamic way. Please help me with some suggestions or maybe this is actually a bug. I also provided the package.json dependencies so that you can see what versions I am using. Sorry for the long issue. Hope this helps. Thanks in advance.

"dependencies": {
    "@angular/common": "^2.4.6",
    "@angular/compiler": "^2.4.6",
    "@angular/core": "^2.4.6",
    "@angular/forms": "^2.4.6",
    "@angular/http": "^2.4.6",
    "@angular/material": "^2.0.0-beta.2",
    "@angular/platform-browser": "^2.4.6",
    "@angular/platform-browser-dynamic": "^2.4.6",
    "@angular/router": "^3.3.1",
    "angular-oauth2-oidc": "^1.0.20",
    "bootstrap": "^3.3.7",
    "chart.js": "^2.5.0",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.1.1",
    "moment": "^2.18.0",
    "ng2-charts": "^1.5.0",
    "ng2-cookies": "^1.0.6",
    "ng2-date-time-picker": "^2.0.12",
    "rxjs": "^5.0.1",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.7.2"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0-rc.2",
    "@angular/compiler-cli": "^2.4.6",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.64",
    "codelyzer": "~2.0.0-beta.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-coverage": "^1.1.1",
    "karma-firefox-launcher": "^1.0.0",
    "karma-jasmine": "^1.0.2",
    "karma-phantomjs-launcher": "^1.0.2",
    "karma-remap-istanbul": "^0.6.0",
    "phantomjs": "^2.1.7",
    "phantomjs-prebuilt": "^2.1.14",
    "protractor": "~4.0.13",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.0.3"
  }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 22 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@CriPstian @spy4x

Guys, I searched the problem and I found this.

Basically, because in my directive I create a module dynamically and this procedure is running in JIT. So when you run AOT, it would cause the bug. Right now angular could not run both JIT and AOT at the same time.

And now I already fixed the bug, but I haven’t published a new version. Because I still have to run some tests. Hopefully, I will published package at this weekend.

Thanks guys.

@CriPstian @spy4x

Guys, the package has been updated. Please update to the latest package.

If you find any problems, please let me know.

Thanks.

@CriPstian Try the latest version of “@angular/cli”: “1.0.0”, and see if the error still exists.