Vim li cas tib neeg siv TypeScript?
Vim li cas tib neeg siv TypeScript?

Video: Vim li cas tib neeg siv TypeScript?

Video: Vim li cas tib neeg siv TypeScript?
Video: ๐Ÿš€ RUTUBE and POINT. RUTUBA development in 5 hours *WITHOUT WATER* [Next / React / Nest / PostgreSQL 2024, Hlis ntuj nqeg
Anonim

TypeScript muab cov cuab yeej tsim kho tau zoo rau JavaScript IDEs thiab cov kev coj ua, xws li kev kuaj xyuas zoo li qub. TypeScript ua code yooj yim nyeem thiab nkag siab. Nrog TypeScript , peb tuaj yeem txhim kho loj dua li JavaScript dawb. TypeScript muab peb txhua qhov txiaj ntsig ntawm ES6 (ECMAScript 6), ntxiv rau kev tsim khoom ntau dua.

Tib neeg kuj nug, yog TypeScript tiag tiag?

Txawm tias muaj lwm cov lus teb, kuv yuav tsum hais TypeScript tsis nruj me ntsis tsim nyog . Qhov ntawd yog vim TypeScript belongs rau tsev neeg ntawm cov lus transpiled, cov lus uas muab tso ua ke rau hauv JS qhov chaws. Yog li, qhov tseeb, muaj ntau, ntau yam lus uas koj tuaj yeem xaiv tsis yog TypeScript , piv txwv li: Choj.

Nws puas zoo siv TypeScript nrog cov lus teb? TypeScript yog txaus. Yog li ntawd Teb . Siv TypeScript tso cai rau peb kom tau txais txiaj ntsig ntawm IntelliSense, nrog rau kev muaj peev xwm ntxiv qhov laj thawj ntawm peb cov cai. Raws li qhov no, adopting TypeScript yog ib qho yooj yim raws li cov ntaub ntawv tuaj yeem hloov kho ntxiv yam tsis muaj teeb meem thoob plaws hauv koj qhov project.

Ua raws li qhov no, vim li cas TS zoo dua JS?

Lub ntsiab kom zoo dua ntawm Typescript tshaj JavaScript yog tias Typescript yog superset ntawm JavaScript . Yog li Typescript tsim los rau kev txhim kho cov kev pab cuam loj uas trans compile rau JavaScript . Txij li nws yog ib hom lus txhais hauv lub web browser, yog li koj tsis tas yuav yuav lub compiler.

Kev siv TypeScript hauv angular yog dab tsi?

TypeScript yog hom lus tseem ceeb rau Daim ntawv thov Angular kev loj hlob. Nws yog superset ntawm JavaScript nrog tsim-lub sij hawm txhawb rau hom kev nyab xeeb thiab cuab yeej. Browsers tsis tuaj yeem ua haujlwm TypeScript ncaj qha. Sau ntawv yuav tsum tau "transpiled" rau hauv JavaScript siv tsc compiler, uas yuav tsum tau ib co configuration.

Pom zoo: