(FRONT) FRONT (2023)

(<< 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

class-validator

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



Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23
Link to this page: http://www.vb-net.com/TsLecture/Library.htm
<SITEMAP>  <MVC>  <ASP>  <NET>  <DATA>  <KIOSK>  <FLEX>  <SQL>  <NOTES>  <LINUX>  <MONO>  <FREEWARE>  <DOCS>  <ENG>  <CHAT ME>  <ABOUT ME>  < THANKS ME>