There is a recommendation for the directory structure in the Angular 2 style guide: https://angular.io/docs/ts/latest/guide/style-guide.html#04-06
I usually find this a good recommendation, I would intend to do something very similar. However, I ran into a problem, and I'm curious if anyone has resolved it.
Please note that the module heroescontains a directory sharedwith heroes-button.component. Presumably, we will want to use this component throughout the application (hence, "shared").
Similarly, the module villainscontains a directory sharedwith villains-button.component.
If I want to use villains-button.componentin some place in the module heroesand heroes-button.componentin the module villains, then I get a circular link.
In short: Angular does not allow me to import ModuleA into ModuleB, and ModuleB into ModuleA, but the style guide says otherwise.
Does anyone have solutions for this scenario?
source
share