Skip to content

fix(generate): ignore duplicate component symbol in module declarations #4446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

delasteve
Copy link
Contributor

@delasteve delasteve commented Feb 6, 2017

ng g c X will no longer insert the component symbol in the NgModule's declaration array should it already exist.

Closes #4323

// cc @beeman, @Meligy

@delasteve delasteve force-pushed the fix/double-declaration branch 4 times, most recently from 72af96b to 2484124 Compare February 6, 2017 23:33
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to configure your editor better...

return new NoopChange();
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge these 2 if?

@@ -254,7 +262,7 @@ function _addSymbolToNgModuleMetadata(ngModulePath: string, metadataField: strin
* into NgModule declarations. It also imports the component.
*/
export function addDeclarationToModule(modulePath: string, classifiedName: string,
importPath: string): Promise<Change> {
importPath: string): Promise<Change> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these.

@@ -54,13 +54,13 @@ export default Blueprint.extend({

let defaultPrefix = '';
if (this.project.ngConfig &&
this.project.ngConfig.apps[0] &&
this.project.ngConfig.apps[0].prefix) {
this.project.ngConfig.apps[0] &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these whitespace changes.

@delasteve delasteve force-pushed the fix/double-declaration branch 4 times, most recently from 7e393c1 to c3df47f Compare February 7, 2017 01:35
@delasteve
Copy link
Contributor Author

@hansl fixed :)

@delasteve delasteve force-pushed the fix/double-declaration branch from c3df47f to 4d491ec Compare February 9, 2017 14:31
"ng g c X" will no longer insert the component symbol in the NgModule's declaration array should it already exist.

Closes angular#4323
@delasteve delasteve force-pushed the fix/double-declaration branch from 4d491ec to 25ca13a Compare February 9, 2017 14:44
@filipesilva
Copy link
Contributor

Seems like the changes @hansl asked for were made so marking for merge.

@hansl hansl merged commit 9c25f74 into angular:master Feb 17, 2017
@delasteve delasteve deleted the fix/double-declaration branch February 22, 2017 20:12
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
…ymbol (angular#4446)

"ng g c X" will no longer insert the component symbol in the NgModule's declaration array should it already exist.

Closes angular#4323
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng generate adds component to module even if the generated component is identical
4 participants