{"action":"created","issue":{"url":"https://api.github.com/repos/DanielYKPan/date-time-picker/issues/15","repository_url":"https://api.github.com/repos/DanielYKPan/date-time-picker","labels_url":"https://api.github.com/repos/DanielYKPan/date-time-picker/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/DanielYKPan/date-time-picker/issues/15/comments","events_url":"https://api.github.com/repos/DanielYKPan/date-time-picker/issues/15/events","html_url":"https://github.com/DanielYKPan/date-time-picker/issues/15","id":218209361,"number":15,"title":"Only on production environment the input click generates an error","user":{"login":"CriPstian","id":10658360,"avatar_url":"https://avatars1.githubusercontent.com/u/10658360?v=3","gravatar_id":"","url":"https://api.github.com/users/CriPstian","html_url":"https://github.com/CriPstian","followers_url":"https://api.github.com/users/CriPstian/followers","following_url":"https://api.github.com/users/CriPstian/following{/other_user}","gists_url":"https://api.github.com/users/CriPstian/gists{/gist_id}","starred_url":"https://api.github.com/users/CriPstian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CriPstian/subscriptions","organizations_url":"https://api.github.com/users/CriPstian/orgs","repos_url":"https://api.github.com/users/CriPstian/repos","events_url":"https://api.github.com/users/CriPstian/events{/privacy}","received_events_url":"https://api.github.com/users/CriPstian/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-30T14:07:26Z","updated_at":"2017-04-14T08:52:43Z","closed_at":"2017-04-01T20:37:26Z","body":"Everything on development works just the way it should.\r\nOn the click event the calendar is shown and enables me to pick a date.\r\nWhen 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.\r\n\r\n```HTML\r\n<input mdInput class=\"picker-input\" [ngModel]=\"transactionForm.date | date: 'short'\" required=\"true\" [(dateTimePicker)]=\"transactionForm.date\" placeholder=\"Date\" dividerColor=\"none\" readonly [theme]=\"'green'\" [locale]=\"'ro'\">\r\n```\r\nSo here is the console error that I receive:\r\n![selection_010](https://cloud.githubusercontent.com/assets/10658360/24507934/9873cbba-156a-11e7-90b8-b09289c916ea.png)\r\n\r\nI 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.\r\n\r\n```json\r\n\"dependencies\": {\r\n    \"@angular/common\": \"^2.4.6\",\r\n    \"@angular/compiler\": \"^2.4.6\",\r\n    \"@angular/core\": \"^2.4.6\",\r\n    \"@angular/forms\": \"^2.4.6\",\r\n    \"@angular/http\": \"^2.4.6\",\r\n    \"@angular/material\": \"^2.0.0-beta.2\",\r\n    \"@angular/platform-browser\": \"^2.4.6\",\r\n    \"@angular/platform-browser-dynamic\": \"^2.4.6\",\r\n    \"@angular/router\": \"^3.3.1\",\r\n    \"angular-oauth2-oidc\": \"^1.0.20\",\r\n    \"bootstrap\": \"^3.3.7\",\r\n    \"chart.js\": \"^2.5.0\",\r\n    \"core-js\": \"^2.4.1\",\r\n    \"font-awesome\": \"^4.7.0\",\r\n    \"hammerjs\": \"^2.0.8\",\r\n    \"jquery\": \"^3.1.1\",\r\n    \"moment\": \"^2.18.0\",\r\n    \"ng2-charts\": \"^1.5.0\",\r\n    \"ng2-cookies\": \"^1.0.6\",\r\n    \"ng2-date-time-picker\": \"^2.0.12\",\r\n    \"rxjs\": \"^5.0.1\",\r\n    \"ts-helpers\": \"^1.1.1\",\r\n    \"zone.js\": \"^0.7.2\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@angular/cli\": \"^1.0.0-rc.2\",\r\n    \"@angular/compiler-cli\": \"^2.4.6\",\r\n    \"@types/jasmine\": \"2.5.38\",\r\n    \"@types/node\": \"^6.0.64\",\r\n    \"codelyzer\": \"~2.0.0-beta.1\",\r\n    \"jasmine-core\": \"2.5.2\",\r\n    \"jasmine-spec-reporter\": \"2.5.0\",\r\n    \"karma\": \"1.2.0\",\r\n    \"karma-chrome-launcher\": \"^2.0.0\",\r\n    \"karma-cli\": \"^1.0.1\",\r\n    \"karma-coverage\": \"^1.1.1\",\r\n    \"karma-firefox-launcher\": \"^1.0.0\",\r\n    \"karma-jasmine\": \"^1.0.2\",\r\n    \"karma-phantomjs-launcher\": \"^1.0.2\",\r\n    \"karma-remap-istanbul\": \"^0.6.0\",\r\n    \"phantomjs\": \"^2.1.7\",\r\n    \"phantomjs-prebuilt\": \"^2.1.14\",\r\n    \"protractor\": \"~4.0.13\",\r\n    \"ts-node\": \"1.2.1\",\r\n    \"tslint\": \"^4.3.0\",\r\n    \"typescript\": \"~2.0.3\"\r\n  }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/DanielYKPan/date-time-picker/issues/comments/294119138","html_url":"https://github.com/DanielYKPan/date-time-picker/issues/15#issuecomment-294119138","issue_url":"https://api.github.com/repos/DanielYKPan/date-time-picker/issues/15","id":294119138,"user":{"login":"spy4x","id":4995814,"avatar_url":"https://avatars1.githubusercontent.com/u/4995814?v=3","gravatar_id":"","url":"https://api.github.com/users/spy4x","html_url":"https://github.com/spy4x","followers_url":"https://api.github.com/users/spy4x/followers","following_url":"https://api.github.com/users/spy4x/following{/other_user}","gists_url":"https://api.github.com/users/spy4x/gists{/gist_id}","starred_url":"https://api.github.com/users/spy4x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spy4x/subscriptions","organizations_url":"https://api.github.com/users/spy4x/orgs","repos_url":"https://api.github.com/users/spy4x/repos","events_url":"https://api.github.com/users/spy4x/events{/privacy}","received_events_url":"https://api.github.com/users/spy4x/received_events","type":"User","site_admin":false},"created_at":"2017-04-14T08:52:43Z","updated_at":"2017-04-14T08:52:43Z","body":"Hello @DanielYKPan and thank you a lot for this awesome datetimepicker 👍 \r\n\r\nUnfortunately I met the same issue with AOT, Angular v4.0, Angular CLI v1.0.\r\nSome details below:\r\n```html\r\n<div \r\n  [(dateTimePicker)]=\"value\"\r\n  [returnObject]=\"'moment'\"\r\n  [mode]=\"'dropdown'\"\r\n  [style.width]=\"'250px'\">\r\n  <input type=\" value=\"{{value.format('YYYY.MM.DD HH:mm')}}\">\r\n</div>\r\n```\r\n\r\n```typescript\r\nimport { Component } from '@angular/core';\r\nimport * as moment from 'moment';\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  templateUrl: './app.component.html',\r\n  styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {\r\n  value = moment();\r\n}\r\n```\r\n\r\n<img width=\"1279\" alt=\"screen shot 2017-04-13 at 15 46 30\" src=\"https://cloud.githubusercontent.com/assets/4995814/25038458/94f8dd1a-2107-11e7-82c5-43a3a7a4fe95.png\">\r\nI've created repository to show this issue:\r\nhttps://github.com/spy4x/detetimepicker-bug-demo\r\nJust a demo repo, will be removed once issue solved.\r\n\r\nSetup:\r\n\r\n```json\r\n{\r\n  \"dependencies\": {\r\n    \"@angular/common\": \"^4.0.0\",\r\n    \"@angular/compiler\": \"^4.0.0\",\r\n    \"@angular/core\": \"^4.0.0\",\r\n    \"@angular/forms\": \"^4.0.0\",\r\n    \"@angular/http\": \"^4.0.0\",\r\n    \"@angular/platform-browser\": \"^4.0.0\",\r\n    \"@angular/platform-browser-dynamic\": \"^4.0.0\",\r\n    \"@angular/router\": \"^4.0.0\",\r\n    \"core-js\": \"^2.4.1\",\r\n    \"ng-pick-datetime\": \"^4.0.5\",\r\n    \"rxjs\": \"^5.1.0\",\r\n    \"zone.js\": \"^0.8.4\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@angular/cli\": \"1.0.0\",\r\n    \"@angular/compiler-cli\": \"^4.0.0\",\r\n    \"@types/jasmine\": \"2.5.38\",\r\n    \"@types/node\": \"~6.0.60\",\r\n    \"codelyzer\": \"~2.0.0\",\r\n    \"jasmine-core\": \"~2.5.2\",\r\n    \"jasmine-spec-reporter\": \"~3.2.0\",\r\n    \"karma\": \"~1.4.1\",\r\n    \"karma-chrome-launcher\": \"~2.0.0\",\r\n    \"karma-cli\": \"~1.0.1\",\r\n    \"karma-coverage-istanbul-reporter\": \"^0.2.0\",\r\n    \"karma-jasmine\": \"~1.1.0\",\r\n    \"karma-jasmine-html-reporter\": \"^0.2.2\",\r\n    \"protractor\": \"~5.1.0\",\r\n    \"ts-node\": \"~2.0.0\",\r\n    \"tslint\": \"~4.5.0\",\r\n    \"typescript\": \"~2.2.0\"\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"spy4x"}}