03 Depedency Injection in Nest JS | Inject Service in Controller | Node JS, Javascript, Typescript

preview_player
Показать описание
In this video, we are going to create a Service class which will be responsible for playing with the data and returning it to the controller.

We will look at how we can use the Injectable decorator to inject the Service inside the Controller. And, also we will see why we need to add the Service inside the Providers decorator and then Nest JS injects that class.

And, what kind of errors you can expect if you don't add correct provider definitions in the module file.

Рекомендации по теме
Комментарии
Автор

Thanks man it now clear for me how it work and best part is you create controller manually so i also follow this and now flow is clear.. before this i created by command line so don't know the flow.

thanks

vinaykaithwas
Автор

you guys from youtube tutorials are really cool! god bless you

Kaine
Автор

if you are interested in watching this whole series, this is what you are in for, I thought it useful to calculate and share, since somehow Youtube doesn't automatically provide this information (?)
TOTAL SERIES DURATION 7:16:34
Introduction to Nest JS - A Node JS framework - from the basics | Nest js tutorials 0:05:59
01 Install Nest JS and how Nest Js route works | Nest JS Node JS tutorials 0:10:32
02 Creating a Module and Controller in Nest JS | Node JS, Javascript, Typescript 0:11:30
03 Depedency Injection in Nest JS | Inject Service in Controller | Node JS, Javascript, Typescript 0:07:58
04 Validatioin in Nest JS and DTO objects | Nest JS Node JS tutorials 0:10:14
06 Saving quiz data to Database in TypeORM using services and Repository NestJs tutorieal 0:08:04
07 Creating the Question entity for Quiz 0:12:54
08 Entity relation with TypeORM and saving questions 0:16:48
09 Refactoring the quiz module and moving things to make more sense using VS Code 0:05:57
10 Additing options to a questions using Type ORM relations - Part 1 0:10:34
11 Additing options to a questions using Type ORM relations - Part 2 0:12:18
12 Loading quiz with questions - query, joins and nested relations in TypeORM 0:14:14
13 Show Quiz with questions and options | Type ORM second level relation 0:06:11
14 Nestjs Config module to work with env files and hide your secrets from codebase 0:14:55
15 Nestjs | User registration and password hash with bcrypt with TypeORM Hooks 0:26:32
16 How to run or setup migrations in Nest JS with TypeORM 0:17:23
17 NestJS JWT Token for API authentication, Passport - API security 0:37:31
18 Nest JS JWT Secret through config and env file 0:10:13
19 Nest JS JWT Swagger API documentation setup 0:12:29
20 Pagination with Nest JS - How to get paginated data with Type ORM and Nest JS 0:11:14
21 Nest JS TypeORM Seeder setup | How to use Seeds and Factories with NestJs and TypeORM and more 0:13:57
22 Nest JS adding columns to a database table TypeORM using migrations 0:11:10
23 Nest JS How to use middleware in Nest JS and it's concept 0:09:40
24 Nest JS Custom exceptions and why they are useful 0:07:10
25 Nest JS Trick to use sample data while development 0:12:27
26 Nest JS Guards what are they and how to use them 0:11:50
28 Nest JS Events and how to do event driven development in Node Nest JS framework 0:18:41
27 Nest JS Dynamic role guard to handle multiple roles for different API 0:10:42
29 Nestjs API to upload files 0:15:04
30 Nestjs and Meilisearch backend implementation 0:22:54
31 Unlocking Full Text Search with NestJs, Meilisearch and ReactJs 0:15:48
NestJs migrations with TypeORM 0.3 (latest) - How to set it up from scratch using Datasource 0:23:41

az_spain
Автор

Nice video 🙏
I am trying to inject one service and it's mock.
I want to inject service or it's mock based on an environment variable say MOCK.
How may I do it in nest.js?
Thank you

pradipspeaks
Автор

what is the extension for file type icons sir ?
nice video

developerbox
Автор

Simply type "nest g s modules/quiz"

arifamrullah
Автор

First btw anyway to include all routes in one file like Laravel

tanzimibthesam