DEPENDENCY INJECTION (NESTJS - TYPESCRIPT) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 5

DEPENDENCY INJECTION (NESTJS - TYPESCRIPT)

https://www.sololearn.com/post/1571828/?ref=app How would you explain dependency injection to a non-programmer or newbie developer? // DEPENDENCY INJECTION // NestJS - TypeScript /* How would you explain dependency injection to a non-programmer? */ import {Component} from '@angular/core'; import {CarService} from './car.service'; import {Car} from './car'; ... export class AppComponent { cars : Car[]; constructor(private carService : CarService) { this.cars = this.carService.getCars(); } }

12th Mar 2022, 1:01 PM
šŸ‘‘ Tchybooxuur!
šŸ‘‘ Tchybooxuur! - avatar
2 Respostas
+ 1
It's a module/component injected in the constructor of class to be used by this and this is a mechanism that let you abstract external functionality from classes where they are used
25th Mar 2022, 1:42 PM
Daniel Edmundo RodrĆ­guez LĆ³pez Serra
Daniel Edmundo RodrĆ­guez LĆ³pez Serra - avatar
25th Mar 2022, 1:52 PM
šŸ‘‘ Tchybooxuur!
šŸ‘‘ Tchybooxuur! - avatar