Dab tsi yog lub Hoobkas tivthaiv?
Dab tsi yog lub Hoobkas tivthaiv?

Video: Dab tsi yog lub Hoobkas tivthaiv?

Video: Dab tsi yog lub Hoobkas tivthaiv?
Video: lub hom phiaj loj tshaj plaws ntawm kev ntseeg yog dab tsi 2024, Kaum ib hlis
Anonim

A Hoobkas khoom yog ib qho kev ua haujlwm sib xyaw. Structurely, nws muaj cov txheej txheem kev xav thiab kev npaj tsim khoom. Cwj pwm, nws delegates nws cov dej num rau lwm tus Hoobkas khoom los yog tej hauj lwm.

Ntawm no, dab tsi yog cov khoom lag luam hauv angular?

Cheebtsam Hoobkas thiab compiler In Angular txhua tiv thaiv yog tsim los ntawm a Hoobkas . Thiab factories yog tsim los ntawm lub compiler siv cov ntaub ntawv koj muab rau hauv @ Cheebtsam kho kom zoo nkauj. Hauv qab hood Angular siv lub tswv yim ntawm Saib. Lub hauv paus ntsiab lus khiav yog qhov tseem ceeb ntawm tsob ntoo ntawm kev pom.

Tsis tas li ntawd, ComponentRef yog dab tsi? ComponentRef chav kawm sawv cev ib qho piv txwv ntawm a Cheebtsam tsim los ntawm ComponentFactory. ComponentRef muab kev nkag mus rau lub Cheebtsam Piv txwv li thiab lwm yam khoom muaj feem xyuam rau qhov no Cheebtsam Piv txwv thiab tso cai rau koj los rhuav tshem cov Cheebtsam Piv txwv ntawm cov ComponentRef.

Ib yam li ntawd, nws yog nug, dab tsi yog qhov dynamic angular Cheebtsam?

Dynamic txhais tau tias, qhov cov khoom qhov chaw nyob rau hauv daim ntawv thov tsis tau txhais nyob rau hauv buildtime. Qhov ntawd txhais tau hais tias nws tsis siv nyob rau hauv ib qho twg lub kaum sab xis tus qauv. Es tsis txhob, lub tiv thaiv yog instantiated thiab muab tso rau hauv daim ntawv thov ntawm runtime.

Dab tsi yog cov ntsiab lus kev cai hauv angular?

Angular Custom Elements yog qhov tsis ntev los no ntxiv rau Angular lub moj khaum uas tso cai rau koj los tsim cov khoom xa tawm. Hauv lwm lo lus, thaum twg peb tsim ib qho Angular Element , peb tsim ib qho tshiab kev cai HTML keeb uas tuaj yeem siv rau ntawm ib lub vev xaib, txawm tias lub vev xaib tsis siv Angular tag nrho.

Pom zoo: