<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 =&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></p>

<p dir="auto"><code class="notranslate">ngc</code> command fails when "noUnusedParameters" is set in tsconfig.json with <code class="notranslate">'$event' is declared but never used</code> even if <code class="notranslate">$event</code> is not declared anywhere.</p>
<p dir="auto"><strong>Expected behavior</strong></p>

<p dir="auto"><code class="notranslate">ngc</code> should not fail when "noUnusedParameters" is set in tsconfig.json.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>

<p dir="auto"><a href="https://github.com/n9niwas/ngissue">Repository with reproduction</a>. Run <code class="notranslate">yarn start</code> (<code class="notranslate">npm start</code>).</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>

<p dir="auto">Support of "noUnusedParameters" TypeScript setting.</p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>

<p dir="auto">Operating system: Windows 10.</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 4.0.0</li>
</ul>

<ul dir="auto">
<li>
<p dir="auto"><strong>Language:</strong> [TypeScript 2.2]</p>
</li>
<li>
<p dir="auto"><strong>Node (for AoT issues):</strong> <code class="notranslate">node --version</code> =  v7.7.2</p>
</li>
</ul>
<p dir="auto">If I have a set of directives that collaborate to get stuff done (e.g <code class="notranslate">DefaultValueAccessor</code> and <code class="notranslate">NgModel</code>) and I include just one of them, I might get very poor error messages about stuff being null.</p>
<p dir="auto">Example with declaring view dependency on NgModel rather than on FORM_DIRECTIVES results in this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="EXCEPTION: No value accessor for '' in [null]
angular2.min.js:16 EXCEPTION: No value accessor for '' in [null]t.logError @ angular2.min.js:16t.logGroup @ angular2.min.js:16e.call @ angular2.min.js:3(anonymous function) @ angular2.min.js:16e._onError @ angular2.min.js:9t.onError @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1O @ angular2.min.js:1A @ angular2.min.js:1I @ angular2.min.js:1(anonymous function) @ angular2.min.js:1r @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1
angular2.min.js:16 ORIGINAL EXCEPTION: No value accessor for ''t.logError @ angular2.min.js:16e.call @ angular2.min.js:3(anonymous function) @ angular2.min.js:16e._onError @ angular2.min.js:9t.onError @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1O @ angular2.min.js:1A @ angular2.min.js:1I @ angular2.min.js:1(anonymous function) @ angular2.min.js:1r @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1
angular2.min.js:16 ORIGINAL STACKTRACE:t.logError @ angular2.min.js:16e.call @ angular2.min.js:3(anonymous function) @ angular2.min.js:16e._onError @ angular2.min.js:9t.onError @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1O @ angular2.min.js:1A @ angular2.min.js:1I @ angular2.min.js:1(anonymous function) @ angular2.min.js:1r @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1
angular2.min.js:16 Error: No value accessor for ''
    at new t (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:12:23656)
    at o (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:21:17177)
    at Object.i [as setUpControl] (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:21:16718)
    at t.onChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:10:3971)
    at e.ChangeDetector_App_0.detectChangesInRecordsInternal (eval at &lt;anonymous&gt; (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:11265), &lt;anonymous&gt;:41:57)
    at e.detectChangesInRecords (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4786)
    at e.runDetectChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4363)
    at e._detectChangesInShadowDomChildren (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:6205)
    at e.runDetectChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4476)
    at e.detectChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4094)"><pre class="notranslate"><code class="notranslate">EXCEPTION: No value accessor for '' in [null]
angular2.min.js:16 EXCEPTION: No value accessor for '' in [null]t.logError @ angular2.min.js:16t.logGroup @ angular2.min.js:16e.call @ angular2.min.js:3(anonymous function) @ angular2.min.js:16e._onError @ angular2.min.js:9t.onError @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1O @ angular2.min.js:1A @ angular2.min.js:1I @ angular2.min.js:1(anonymous function) @ angular2.min.js:1r @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1
angular2.min.js:16 ORIGINAL EXCEPTION: No value accessor for ''t.logError @ angular2.min.js:16e.call @ angular2.min.js:3(anonymous function) @ angular2.min.js:16e._onError @ angular2.min.js:9t.onError @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1O @ angular2.min.js:1A @ angular2.min.js:1I @ angular2.min.js:1(anonymous function) @ angular2.min.js:1r @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1
angular2.min.js:16 ORIGINAL STACKTRACE:t.logError @ angular2.min.js:16e.call @ angular2.min.js:3(anonymous function) @ angular2.min.js:16e._onError @ angular2.min.js:9t.onError @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1O @ angular2.min.js:1A @ angular2.min.js:1I @ angular2.min.js:1(anonymous function) @ angular2.min.js:1r @ angular2.min.js:9n.run @ angular2.min.js:1(anonymous function) @ angular2.min.js:9(anonymous function) @ angular2.min.js:1h @ angular2.min.js:1
angular2.min.js:16 Error: No value accessor for ''
    at new t (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:12:23656)
    at o (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:21:17177)
    at Object.i [as setUpControl] (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:21:16718)
    at t.onChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:10:3971)
    at e.ChangeDetector_App_0.detectChangesInRecordsInternal (eval at &lt;anonymous&gt; (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:11265), &lt;anonymous&gt;:41:57)
    at e.detectChangesInRecords (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4786)
    at e.runDetectChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4363)
    at e._detectChangesInShadowDomChildren (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:6205)
    at e.runDetectChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4476)
    at e.detectChanges (https://code.angularjs.org/2.0.0-alpha.39/angular2.min.js:17:4094)
</code></pre></div>
<p dir="auto">It would be great if we either warned about the missing dependency or included it by default (too much magic?). Maybe just throwing an error saying please import "FORM_DIRECTIVES" would be the best.</p>