(<< Back <<) Useful TS 3rd party library (<< Back <<)
Maximilian Schwarzmüller Typescript Lecture notes.
install @types/xxx --save-dev, Lodash, Validators, using class-transformer and import 'reflect-metadata', declare external variables from Html level (setting)
1 - Module Introduction.mp4 2 - Using JavaScript ( ) Libraries with TypeScript.mp4 3 - Using declare as a Last Resort.mp4 4 - No Types Needed class-transformer.mp4 5 - TypeScript-embracing class-validator.mp4 6 - Wrap Up.mp4
Various useful JS library embrace helpful functional, for example Lodash contains a lot of functions to working with Array, Number, Object, String, Math, Date, Collection and so on.
Even if we block TS errors function will not working on runtime
We need install @types/xxxx --save-dev (locally)
Most JS library has @types
But TS don't see global variables defined on Html level
This is trick what allow to use external variable, need to use DECLARE statement and this way allow access to various setting on Html level
Some library has no need types, for example class-transformer
This is class
This is array of Anonymous class
To create array of class we nee to use MAP, this is traditional JS way
But we need to use class-transformer
This is generic function what can automatically convert object to TS class
After transformation used, all working fine without installation @types, we need just Import 'reflect-metadata' - dynamic definition of new class
Other similar class - https://github.com/orgs/typestack/repositories
We need install class-validator and allow to use decorator on TS confog
Setup restriction from Validator
We want to prevent empty titile
For using class-validator we need to finally validate all restrinction
Validate is asynchronous, return Promise, we need to use Then
And check how validator works
Related pages
- Angular documentation
- Typescript documentation
- Javascript documentation
- ECMAScript ES6 vs Typescript
- React vs Angular
- (2023) CloudflareWorker and Supabase
- (2022) NativeScript, AndroidBooks
- (2022) JS, Css
- (2022) Typescript, Webpack
- (2022) Angular, RxJs, Firebase, MongoDb
- (2022) Node, NestJs, Electron, Pwa, Telegram
- (2022) React, Redux, GraphQL, NextJs
- (2022) Angular/Typescript, JS books
<SITEMAP> <MVC> <ASP> <NET> <DATA> <KIOSK> <FLEX> <SQL> <NOTES> <LINUX> <MONO> <FREEWARE> <DOCS> <ENG> <CHAT ME> <ABOUT ME> < THANKS ME> |