{"action":"created","issue":{"url":"https://api.github.com/repos/ocombe/ng2-translate/issues/281","repository_url":"https://api.github.com/repos/ocombe/ng2-translate","labels_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/281/comments","events_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/281/events","html_url":"https://github.com/ocombe/ng2-translate/issues/281","id":183577501,"number":281,"title":"AoT compilation fails - again","user":{"login":"timfogarty1549","id":7799954,"avatar_url":"https://avatars.githubusercontent.com/u/7799954?v=3","gravatar_id":"","url":"https://api.github.com/users/timfogarty1549","html_url":"https://github.com/timfogarty1549","followers_url":"https://api.github.com/users/timfogarty1549/followers","following_url":"https://api.github.com/users/timfogarty1549/following{/other_user}","gists_url":"https://api.github.com/users/timfogarty1549/gists{/gist_id}","starred_url":"https://api.github.com/users/timfogarty1549/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timfogarty1549/subscriptions","organizations_url":"https://api.github.com/users/timfogarty1549/orgs","repos_url":"https://api.github.com/users/timfogarty1549/repos","events_url":"https://api.github.com/users/timfogarty1549/events{/privacy}","received_events_url":"https://api.github.com/users/timfogarty1549/received_events","type":"User","site_admin":false},"labels":[{"id":339286531,"url":"https://api.github.com/repos/ocombe/ng2-translate/labels/Priority:%20medium","name":"Priority: medium","color":"fbca04","default":false},{"id":271502781,"url":"https://api.github.com/repos/ocombe/ng2-translate/labels/Type:%20bug","name":"Type: bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-10-18T02:50:57Z","updated_at":"2016-10-30T19:45:14Z","closed_at":null,"body":"While my app works great with JIT compiling, I have not been able to get AoT to work.  The file appModule.ngfactory.js gets created, but then contains errors.  The error is in the imports.\r\n\r\nIn appModule.ngfactory.js I see ng2-translate gets imported, such as\r\n\r\n`import * as import8 from 'ng2-translate/ng2-translate';`\r\n\r\nbut then later on, it tries to import translate.service with a relative path.\r\n\r\n`import * as import189 from '../../src/translate.service';`\r\n\r\nwhich then gives the error\r\n\r\n```\r\nError: Error at /workspace/project/app/appModule.ngfactory.ts:196:28: \r\nCannot find module '../../src/translate.service'.\r\n```\r\n\r\nit seems to me that in AoT, the import of  '../../src/translate.service'; shouldn't happen at all because the contents of that file was already imported with 'ng2-translate/ng2-translate'.\r\n\r\n\r\nIn my typescript code, I import TranslateModule through SharedModule, but in other classes, I inject TranslateService through the constructor so that I can programmatically access its methods.  For example,\r\n\r\n```\r\nimport {TranslateService} from 'ng2-translate/ng2-translate';\r\n...\r\n\tconstructor( private translate: TranslateService ) {}\r\n...\r\n\tngOnInit() {\r\n\t\tthis.subscription = this._route.params\r\n\t\t\t.flatMap( (params,i) => {\r\n\t\t\t\tthis.results = [];\r\n\t\t\t\tthis.chart = params['chart'];\r\n\t\t\t\treturn this._restService.getStatsChartData( this.chart );\r\n\t\t\t} )\r\n\t\t\t.map( (data) => {\r\n\t\t\t\tthis.results = data;\r\n\t\t\t})\r\n\t\t\t.merge( this.translate.onLangChange )\r\n\t\t\t.flatMap( (data,i) => {\r\n\t\t\t\treturn this.translate.get( \"STATS.\"+this.chart.toUpperCase() );\r\n\t\t\t} )\r\n\t\t\t.subscribe( (values) => {\r\n\t\t\t\tthis.translations = values;\r\n\t\t\t});\r\n\t}\r\n```\r\n\r\n\r\nIs this an error with the ng-translate package, perhaps the metadata.json ? or is it an error in the way I'm importing and injecting TranslateService into my classes?  Again, the app works fine with JIT, but won't compile with AoT."},"comment":{"url":"https://api.github.com/repos/ocombe/ng2-translate/issues/comments/257173851","html_url":"https://github.com/ocombe/ng2-translate/issues/281#issuecomment-257173851","issue_url":"https://api.github.com/repos/ocombe/ng2-translate/issues/281","id":257173851,"user":{"login":"zackarychapple","id":2133184,"avatar_url":"https://avatars.githubusercontent.com/u/2133184?v=3","gravatar_id":"","url":"https://api.github.com/users/zackarychapple","html_url":"https://github.com/zackarychapple","followers_url":"https://api.github.com/users/zackarychapple/followers","following_url":"https://api.github.com/users/zackarychapple/following{/other_user}","gists_url":"https://api.github.com/users/zackarychapple/gists{/gist_id}","starred_url":"https://api.github.com/users/zackarychapple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackarychapple/subscriptions","organizations_url":"https://api.github.com/users/zackarychapple/orgs","repos_url":"https://api.github.com/users/zackarychapple/repos","events_url":"https://api.github.com/users/zackarychapple/events{/privacy}","received_events_url":"https://api.github.com/users/zackarychapple/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T19:45:14Z","updated_at":"2016-10-30T19:45:14Z","body":"@SamVerschueren I was trying to use without the config as well. "}}
{"actor":{"display_login":"zackarychapple"}}