title: No provider for NgForm error in dev mode using Angular 4.4.6
body: <p><strong>EDIT:</strong> I've discovered what is causing the problem; I'm now looking for a solution as to how to cater for it.</p>
  
  <p><em>NOTE</em>: This issue is happening in dev mode (i.e. not prod, and not using aot)</p>
  
  <p>I'm using the "Update" solution from here:</p>
  
  <p><a href="https://stackoverflow.com/a/46324043/3164070">https://stackoverflow.com/a/46324043/3164070</a></p>
  
  <p>To solve an issue with an input in a child component that was not updating the valid flag on the form. It works in a fairly simple test project, however when moving it to our real project, it throws this error:</p>
  
  <pre><code>core.es5.js:1020 ERROR Error: Uncaught (in promise): Error: No provider for NgForm!
  Error: No provider for NgForm!
      at ZoneAwareError (http://192.168.2.34:4200/vendor.bundle.js:153804:33)
      at injectionError (http://192.168.2.34:4200/vendor.bundle.js:1378:90)
      at noProviderError (http://192.168.2.34:4200/vendor.bundle.js:1416:12)
      at ReflectiveInjector_._throwOrNull (http://192.168.2.34:4200/vendor.bundle.js:2858:19)
      at ReflectiveInjector_._getByKeyDefault (http://192.168.2.34:4200/vendor.bundle.js:2897:25)
      at ReflectiveInjector_._getByKey (http://192.168.2.34:4200/vendor.bundle.js:2829:25)
      at ReflectiveInjector_.get (http://192.168.2.34:4200/vendor.bundle.js:2698:21)
      at resolveNgModuleDep (http://192.168.2.34:4200/vendor.bundle.js:9701:25)
      at NgModuleRef_.get (http://192.168.2.34:4200/vendor.bundle.js:10771:16)
      at resolveDep (http://192.168.2.34:4200/vendor.bundle.js:11259:45)
      at _createProviderInstance (http://192.168.2.34:4200/vendor.bundle.js:11102:20)
      at resolveDep (http://192.168.2.34:4200/vendor.bundle.js:11238:56)
      at createClass (http://192.168.2.34:4200/vendor.bundle.js:11129:32)
      at createDirectiveInstance (http://192.168.2.34:4200/vendor.bundle.js:10960:37)
      at createViewNodes (http://192.168.2.34:4200/vendor.bundle.js:12401:53)
      at ZoneAwareError (http://192.168.2.34:4200/vendor.bundle.js:153804:33)
      at injectionError (http://192.168.2.34:4200/vendor.bundle.js:1378:90)
      at noProviderError (http://192.168.2.34:4200/vendor.bundle.js:1416:12)
      at ReflectiveInjector_._throwOrNull (http://192.168.2.34:4200/vendor.bundle.js:2858:19)
      at ReflectiveInjector_._getByKeyDefault (http://192.168.2.34:4200/vendor.bundle.js:2897:25)
      at ReflectiveInjector_._getByKey (http://192.168.2.34:4200/vendor.bundle.js:2829:25)
      at ReflectiveInjector_.get (http://192.168.2.34:4200/vendor.bundle.js:2698:21)
      at resolveNgModuleDep (http://192.168.2.34:4200/vendor.bundle.js:9701:25)
      at NgModuleRef_.get (http://192.168.2.34:4200/vendor.bundle.js:10771:16)
      at resolveDep (http://192.168.2.34:4200/vendor.bundle.js:11259:45)
      at _createProviderInstance (http://192.168.2.34:4200/vendor.bundle.js:11102:20)
      at resolveDep (http://192.168.2.34:4200/vendor.bundle.js:11238:56)
      at createClass (http://192.168.2.34:4200/vendor.bundle.js:11129:32)
      at createDirectiveInstance (http://192.168.2.34:4200/vendor.bundle.js:10960:37)
      at createViewNodes (http://192.168.2.34:4200/vendor.bundle.js:12401:53)
      at resolvePromise (http://192.168.2.34:4200/vendor.bundle.js:153599:31) [angular]
      at resolvePromise (http://192.168.2.34:4200/vendor.bundle.js:153570:17) [angular]
      at http://192.168.2.34:4200/vendor.bundle.js:153647:17 [angular]
      at Object.onInvokeTask (http://192.168.2.34:4200/vendor.bundle.js:4090:33) [angular]
      at ZoneDelegate.invokeTask (http://192.168.2.34:4200/vendor.bundle.js:153284:36) [angular]
      at Zone.runTask (http://192.168.2.34:4200/vendor.bundle.js:153052:47) [&lt;root&gt; =&gt; angular]
      at drainMicroTaskQueue (http://192.168.2.34:4200/vendor.bundle.js:153480:35) [&lt;root&gt;]
      at &lt;anonymous&gt; [&lt;root&gt;]
  </code></pre>
  
  <p>The problem is that the same component can be used without being on a form, so there is no provider for NgForm.</p>
  
  <p>Is there some way of using the viewProviders member dynamically in the case where there is no form?</p>