title: angular multiple apps build with client specific components
body: <p>Let imagine that we have an application and several clients that consume it.
  And we have a part of an application that is common for all, but in some angular modules (lazy modules) for different clients we want to have a different logic and view behaviour for some of the components.</p>
  
  <p>For example we have a following lazy loaded module:</p>
  
  <pre><code>{
      path: 'feature1',
      loadChildren: './feature1/feature1.module#Feature1Module',
  }
  </code></pre>
  
  <p>Module definition:</p>
  
  <pre><code>@NgModule({
      imports: [
         ...
      ],
      declarations: [
          FeatureComponent1,
          FeatureComponent2,
          FeatureComponent3,
      ],
  })
  export class Feature1Module {}
  </code></pre>
  
  <p>In <code>FeatureComponent1</code> we using <code>FeatureComponent2</code> and <code>FeatureComponent3</code>.</p>
  
  <p>And here is come <strong>main question</strong>: how we can override nested components functionality and view without redefining a whole chain of definitions(declaring module and it components).</p>
  
  <p>In case of this problem we definitely need a custom build per client. And this problem is solved by angular-cli with definition of 'applications' as many as we need.</p>
  
  <p>angular.json</p>
  
  <pre><code>"projects": {
    "client1": {...},
    "client2": {...},
  }
  </code></pre>
  
  <p>But main question is still not solved.
  If we have different entry points for each of our builds we need to define almost whole definitions to the components we want to override.
  In this case we definitely need a <code>core</code> and <code>shared</code> modules above our clients so they can use common components and services to inherit from and customize their behaviour.</p>
  
  <pre><code>--core
  --shared
  --clients
      --client1
        client1-app.component.ts
        client1-app.module.ts
        --feature1
          feature1.module.ts
          feature-component2.ts
          feature-component3.ts
  
      @NgModule({
          imports: [
  // import feature from shared module
              CommonFeature1Module,
          ],
          declarations: [
  // define client specific components that inherits from core components 
              FeatureComponent2, 
              FeatureComponent3,
          ],
      })
      export class Client1Feature1Module {}
  </code></pre>
  
  <p>Is there any way to avoid such complications?</p>
  
  <p>Maybe I miss something?</p>
  
  <p>Because for now it's looks like when I want to override one component that settles somewhere in the deep of my feature module in some component I need to put a lot of effort to just redefine some logic inside one component and beside this I need to duplicate host component template in some cases.</p>
  
  <p>I also have some thoughts about ComponentFactoryResolver that can help with dynamic instantiation of components I want, but in this case I will need to pass additional providers to my feature module with tokens that holds custom component class definition and also messing up with entry components.</p>
  
  <p>Appreciate any help. </p>