title: Why DI is done at class Constructor in Angular?
body: <p>I've been going through this one article on Angular services. And wondering why in general the instance of the service is created in the class constructor only?</p>
  
  <p>For eg: - some <strong>DemoService</strong> class needs to be consumed in some <strong>DemoComponent</strong>. The instance of service will generally be created in the class constructor.</p>
  
  <pre><code>@Injectable()
  export class DemoService {
   ...
  }
  </code></pre>
  
  <p><strong>DemoComponent</strong></p>
  
  <pre><code>@Component({
    selector: 'app-demo',
    templateUrl: './demo.component.html',
  })
  export class DemoComponent implements OnInit {
    ...
    constructor(
      private demoService: DemoService 
    ) {}
    ...
  }
  </code></pre>
  
  <p>So, my <strong>question</strong> is, Can we instantiate the services inside <code>ngOnInit()</code> life-cycle hook method too?</p>
  
  <p>Doing something like - or some other place maybe.</p>
  
  <pre><code>ngOnInit() {
      // using new DemoService();
  }
  </code></pre>
  
  <p>Thanks.</p>