{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/3158","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/3158/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/3158/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/3158/events","html_url":"https://github.com/angular/angular-cli/pull/3158","id":189686468,"number":3158,"title":"fix(generate): revert change to component dir in generate module","user":{"login":"Meligy","id":171637,"avatar_url":"https://avatars.githubusercontent.com/u/171637?v=3","gravatar_id":"","url":"https://api.github.com/users/Meligy","html_url":"https://github.com/Meligy","followers_url":"https://api.github.com/users/Meligy/followers","following_url":"https://api.github.com/users/Meligy/following{/other_user}","gists_url":"https://api.github.com/users/Meligy/gists{/gist_id}","starred_url":"https://api.github.com/users/Meligy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meligy/subscriptions","organizations_url":"https://api.github.com/users/Meligy/orgs","repos_url":"https://api.github.com/users/Meligy/repos","events_url":"https://api.github.com/users/Meligy/events{/privacy}","received_events_url":"https://api.github.com/users/Meligy/received_events","type":"User","site_admin":false},"labels":[{"id":393399567,"url":"https://api.github.com/repos/angular/angular-cli/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-16T12:16:48Z","updated_at":"2016-11-16T22:51:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/angular/angular-cli/pulls/3158","html_url":"https://github.com/angular/angular-cli/pull/3158","diff_url":"https://github.com/angular/angular-cli/pull/3158.diff","patch_url":"https://github.com/angular/angular-cli/pull/3158.patch"},"body":"fix(generate): revert change to component dir in generate module, as it caused component declaration to go to parent module\r\n\r\nThis fixes regression introduced in the code-review of PR #3066. The PR deals with `generate module` command, and the component generated with the module.\r\n\r\nIn the code review, it was requested to change the way component was created as `flat`. I did that, but this is causing the following problem:\r\n\r\nIf you run:\r\n\r\n```\r\nng new cli-project\r\ncd cli-project\r\nng g module test\r\n```\r\n\r\nThe files are created in `src/app/test` correctly (and hence the tests pass), but the component `src/app/test/test.component.ts` is added to the `NgModule` `declarations` of `AppModule`, not `TestModule`.\r\n\r\nThis is because with switching `flat` false and giving the module folder as the component folder, the CLI looks for a module to add declarations ABOVE the module folder.\r\n\r\nSo, now I reverted the code to the original code in #3066 before the code review."},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/261098572","html_url":"https://github.com/angular/angular-cli/pull/3158#issuecomment-261098572","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/3158","id":261098572,"user":{"login":"Meligy","id":171637,"avatar_url":"https://avatars.githubusercontent.com/u/171637?v=3","gravatar_id":"","url":"https://api.github.com/users/Meligy","html_url":"https://github.com/Meligy","followers_url":"https://api.github.com/users/Meligy/followers","following_url":"https://api.github.com/users/Meligy/following{/other_user}","gists_url":"https://api.github.com/users/Meligy/gists{/gist_id}","starred_url":"https://api.github.com/users/Meligy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meligy/subscriptions","organizations_url":"https://api.github.com/users/Meligy/orgs","repos_url":"https://api.github.com/users/Meligy/repos","events_url":"https://api.github.com/users/Meligy/events{/privacy}","received_events_url":"https://api.github.com/users/Meligy/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T22:51:27Z","updated_at":"2016-11-16T22:51:27Z","body":"Adding @filipesilva since @Brocco is traveling and may not have time to check this.\r\n\r\nThis is important because basically `ng generate module` is broken in the latest release (Adds component to the wrong module)."}}
{"actor":{"display_login":"Meligy"}}