<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ x ] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ x ] bug report =&gt; search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Unused components/pipes/directives in my workspace are detected by the compiler, which throws the error <code class="notranslate">Cannot determine the module for class (...)</code> for each file. It stops compilation, and does not seem be configurable. This is a problem, since I need to have those files in my workspace, but do not need them in the resultant app (partner implementations requiring different combos of shared components). This is especially frustrating with regards to compiling in a webpack loader, which should be able to provide a list of files which are included, regardless of workspace.</p>
<p dir="auto"><strong>Expected behavior</strong><br>
I would expect these errors to be warnings, and/or able to be silenced by a compiler option. Alternatively, with regards to webpack, you could allow a list of files to be inserted, so that a webpack could provide all files in the require chain, instead of all files in the workspace.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
Cannot demo in plunkr, since it uses JIT.</p>
<ol dir="auto">
<li>Create a basic angular app which bootstraps an ngModule with one component, AppComponent</li>
<li>Get this app into a state which can be AOT compiled (should be pretty easy with a hello world)</li>
<li>Add a component to the directory structure, but do not reference it anywhere in your code.</li>
<li>Try to AOT compile again. You will get the warning <code class="notranslate">Cannot determine the module for class</code></li>
</ol>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
My company has a base app for ourselves, and our partners use modified versions of that app as their own. Rather than maintain all partners separately, we use a shared library of common generic components, imported as needed. For our base app, everything is fine, since we use every component. For partners, we cannot use AOT, since some of the components in the shared npm package do not have a declared module.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
Happens across all devices, but the current testing setup is:<br>
WIndows 10<br>
VS Code<br>
Cmder (bash terminal)</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong><br>
v2.1.0 (though we have also tested in 2.3.1</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> All - this is a compiler issue, not browser specific</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> Typescript</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> node v6.3.0</p>
</li>
</ul>
<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[X] bug report
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[X] bug report
[ ] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Using reactive forms in 2 modules fails with an error</p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
It should work</p>
<p dir="auto"><strong>Reproduction of the problem</strong><br>
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via <a href="https://plnkr.co" rel="nofollow">https://plnkr.co</a> or similar (you can use this template as a starting point: <a href="http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5" rel="nofollow">http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5</a>).</p>
<p dir="auto">See <a href="http://plnkr.co/edit/2tFC6CDrcZSg3GxW5qRS?p=preview" rel="nofollow">http://plnkr.co/edit/2tFC6CDrcZSg3GxW5qRS?p=preview</a> which is forked from lazy load example at <a href="https://angular.io/docs/ts/latest/guide/ngmodule.html" rel="nofollow">https://angular.io/docs/ts/latest/guide/ngmodule.html</a> with the minor addition that<br>
app component and crisis detail component  each try to create a FormGroup with a FormControl. When crisis detail is loaded (click on crisis center) it fails with an error:<br>
<code class="notranslate">EXCEPTION: Error: Uncaught (in promise): Type FormControlDirective is part of the declarations of 2 modules: AppModule and CrisisModule!</code><br>
Maybe there's some documentation that shows how to do this correctly - but I haven't found it. I have tried various combinations of including/not including things in the 2 modules and the components but haven't hit on a combination that works. Based on the documentation I've seen this looks like a bug.</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
It shouldn't fail</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
To be able to use reactive forms.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0-rc.5</li>
<li><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]<br>
Chrome</li>
<li><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br>
Typescript</li>
</ul>