{"action":"created","issue":{"url":"https://api.github.com/repos/Nolanus/ng2-page-scroll/issues/35","repository_url":"https://api.github.com/repos/Nolanus/ng2-page-scroll","labels_url":"https://api.github.com/repos/Nolanus/ng2-page-scroll/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/Nolanus/ng2-page-scroll/issues/35/comments","events_url":"https://api.github.com/repos/Nolanus/ng2-page-scroll/issues/35/events","html_url":"https://github.com/Nolanus/ng2-page-scroll/issues/35","id":178710566,"number":35,"title":"Compatibility with Angular AOT","user":{"login":"noemi-salaun","id":2726492,"avatar_url":"https://avatars.githubusercontent.com/u/2726492?v=3","gravatar_id":"","url":"https://api.github.com/users/noemi-salaun","html_url":"https://github.com/noemi-salaun","followers_url":"https://api.github.com/users/noemi-salaun/followers","following_url":"https://api.github.com/users/noemi-salaun/following{/other_user}","gists_url":"https://api.github.com/users/noemi-salaun/gists{/gist_id}","starred_url":"https://api.github.com/users/noemi-salaun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noemi-salaun/subscriptions","organizations_url":"https://api.github.com/users/noemi-salaun/orgs","repos_url":"https://api.github.com/users/noemi-salaun/repos","events_url":"https://api.github.com/users/noemi-salaun/events{/privacy}","received_events_url":"https://api.github.com/users/noemi-salaun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-22T20:20:42Z","updated_at":"2016-10-01T11:06:38Z","closed_at":null,"body":"**Angular version:** 2.0.0\r\n\r\n**ng2-page-scroll version:** 3.1.0\r\n\r\n## Issue\r\nErreur when using Ahead-of-Time compilation.\r\n\r\n```\r\nError: Unexpected value 'Ng2PageScrollModule ' imported by the module 'AppModule'\r\n```\r\n\r\n## Code\r\n```\r\nimport {Ng2PageScrollModule} from 'ng2-page-scroll';\r\n\r\n@NgModule({\r\n    imports: [\r\n        /* Other imports here */\r\n        Ng2PageScrollModule\r\n        ]\r\n})\r\nexport class AppModule {\r\n}\r\n```\r\n\r\nThen use `ngc -p some-tsconfig-aot.json`.\r\n\r\n## TODO\r\n\r\nYou need to add metadata.json files for AOT to understand how your lib works.\r\n\r\n*.metadata.json are generated by the Angular compiler (ngc).\r\n\r\nSee [AOT documentation](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html)\r\n\r\n## Bonus\r\n\r\nI just spend the day updating our internal projects for AOT compatibility. I should be able to do the same with your project. I also make the compability with RollupJS.\r\n\r\nFor ease of the integration of AOT and rollup, and avoid the need to set up projects that will use your lib, it must respect some convention. But I do not want to impose my way of doing to your code 😉 \r\n"},"comment":{"url":"https://api.github.com/repos/Nolanus/ng2-page-scroll/issues/comments/250906580","html_url":"https://github.com/Nolanus/ng2-page-scroll/issues/35#issuecomment-250906580","issue_url":"https://api.github.com/repos/Nolanus/ng2-page-scroll/issues/35","id":250906580,"user":{"login":"Nolanus","id":3458616,"avatar_url":"https://avatars.githubusercontent.com/u/3458616?v=3","gravatar_id":"","url":"https://api.github.com/users/Nolanus","html_url":"https://github.com/Nolanus","followers_url":"https://api.github.com/users/Nolanus/followers","following_url":"https://api.github.com/users/Nolanus/following{/other_user}","gists_url":"https://api.github.com/users/Nolanus/gists{/gist_id}","starred_url":"https://api.github.com/users/Nolanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nolanus/subscriptions","organizations_url":"https://api.github.com/users/Nolanus/orgs","repos_url":"https://api.github.com/users/Nolanus/repos","events_url":"https://api.github.com/users/Nolanus/events{/privacy}","received_events_url":"https://api.github.com/users/Nolanus/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T11:06:38Z","updated_at":"2016-10-01T11:06:38Z","body":"Hi,\r\n\r\nI was able to get ngc compiling the sources. Check out the [aot-support branch](https://github.com/Nolanus/ng2-page-scroll/tree/aot-support). Unfortunately I get an error with the \"Document\" type (`Could not resolve type Document (position 46:123 in the original .ts file), resolving symbol PageScroll in ng2-page-scroll/src/ng2-page-scroll.directive.ts`) and I didn't manage to wrap my head around how to include the json's and ngfactories in the library build...\r\nAppreciating your hints for that!\r\n\r\nSebastian"}}
{"actor":{"display_login":"Nolanus"}}