title: NullInjectorError: No provider for class
body: <p>I have injected class as dependency injection in component class and get an error</p>
  <blockquote>
  <p>NullInjectorError: No provider for class</p>
  </blockquote>
  <p>Here is my code:</p>
  <pre><code>// Component
  import { Formation } from './Models/Formation';
  
  export class FormationComponent {
    constructor(private formation: Formation) { }
  }
  
  // Model Class
  export class Formation {
  }
  </code></pre>
  <p>What would be the problem?</p>