You need:
- Node
- NPM
Before run, install this dependencies
npm i -y
npm i typescript
npm i --save date-fns
npm i -D @types/lodash
npm i -D ts-node
npm i @capacitor/camera
npm install --save-dev @faker-js/
faker
npm i axios
npm i -D class-validator
Or
run in main folder npm install
To compile TS code, you need to use npx tsc
or npx tsc --watch
in main directory.
If you want to run code, move to dist folder and run node 'file name'
Or
Using ts-node
npx ts-node 'file.ts'
BASIC
- Hello World
- Numbers
- Booleans
- Strings
- Arrays
- Any
- Union Types
- Alias
- Null and Undefined
- Fuctions
- Void functions
- Objects in functions
- Objects
- Import / Export (product folder)
- Using TS in compatible lib (date-fns)
- Using TS in non compatible Lib (lodash)
INTERMEDIATE
- Enums
- Tuples
- Unknow
- Never
- Optional Params and Nullish-coalescing
- Default
- Rest
- Overload
- Overload II
- Interfaces
- Create Complex Interfaces (app folder)
- Inheritance in Interfaces
- Readonly
- CRUD
- Omit and Pick Type
- Partial and Required
- Readonly
- Type param in function
- Readonly Array
ADVANCED
- First Class
- Methods
- Public
- Private
- Constructor
- Getters
- Setters
- Inheritance
- Protected
- Static
- Interfaces
- Abstract
- Singleton (SOLID)
- Promises
- App (Type HTTP Response)
- Functions to classes
- Main 2. Product Memory
- Connect to Web API
- Main 3. CRUD from API
- Generics
- Generics Class
- Generic Methods
- Decorators
When you shouldn't send id or other param like created at, we can omit this, for example, in mongodb or in RDB. We have this:
{
"id": '045fdssdf44sdfsdf279',
"title": 'My product',
"price": 50,
"createdAt": "2022-08-03T16:20:53"
}
In that non relatinal DB's, we not send id, or in RDB not send created at, so we send:
{
"id": '045fdssdf44sdfsdf279',
"title": 'My product',
"price": 50
}
In this example we omit this params, but we recivied all params from the backend. This data is called DTO.