Issue 1:
[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Unused components/pipes/directives in my workspace are detected by the compiler, which throws the error Cannot determine the module for class (...) 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.

Expected behavior

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.

Minimal reproduction of the problem with instructions

Cannot demo in plunkr, since it uses JIT.

Create a basic angular app which bootstraps an ngModule with one component, AppComponent

Get this app into a state which can be AOT compiled (should be pretty easy with a hello world)

Add a component to the directory structure, but do not reference it anywhere in your code.

Try to AOT compile again. You will get the warning Cannot determine the module for class

What is the motivation / use case for changing the behavior?

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.

Please tell us about your environment:

Happens across all devices, but the current testing setup is:

WIndows 10

VS Code

Cmder (bash terminal)

Angular version:

v2.1.0 (though we have also tested in 2.3.1

Browser: All - this is a compiler issue, not browser specific

Language: Typescript

Node (for AoT issues): node v6.3.0

Issue 2:
I'm submitting a ... (check one with "x")

[X] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Using reactive forms in 2 modules fails with an error

Expected/desired behavior

It should work

Reproduction of the problem

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 https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

See http://plnkr.co/edit/2tFC6CDrcZSg3GxW5qRS?p=preview which is forked from lazy load example at https://angular.io/docs/ts/latest/guide/ngmodule.html with the minor addition that

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:

EXCEPTION: Error: Uncaught (in promise): Type FormControlDirective is part of the declarations of 2 modules: AppModule and CrisisModule!

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.

What is the expected behavior?

It shouldn't fail

What is the motivation / use case for changing the behavior?

To be able to use reactive forms.

Please tell us about your environment:

Angular version: 2.0.0-rc.5

Browser: [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 ]

Chrome

Language: [all | TypeScript X.X | ES6/7 | ES5]

Typescript