Dab tsi yog template hauv angular 4?
Dab tsi yog template hauv angular 4?

Video: Dab tsi yog template hauv angular 4?

Video: Dab tsi yog template hauv angular 4?
Video: Опыт эксплуатации MacBook Air M1 - три месяца в моих программистских руках. M1 в реальной жизни 2024, Kaum ib hlis
Anonim

Cov qauv tau txhais nyob rau hauv @Component decorator. Koj muaj peev xwm txhais inline HTML cov qauv zoo li sab nraud cov qauv hauv HTML cov ntaub ntawv. Koj tseem tuaj yeem tso saib cov ntaub ntawv teev tseg hauv cov khoom siv los ntawm kev cuam tshuam, nrog rau siv ntau yam xwm txheej hauv lub tus qauv.

Hauv qhov no, dab tsi yog tus qauv hauv angular?

Templates hauv AngularJS tsuas yog ib cov ntaub ntawv HTML sau los yog enriched nrog AngularJS cov khoom xws li tus cwj pwm thiab cov lus qhia. Cov lus qhia yog ib qho cim cim uas yog siv los tsom rau ib qho cwj pwm tshwj xeeb lossis chav kawm los ua nws tus cwj pwm raws li qhov xav tau.

Tsis tas li ntawd, dab tsi yog decorators nyob rau hauv angular 4? Decorators yog ib qho qauv tsim uas yog siv los cais kev hloov kho lossis kho kom zoo nkauj ntawm chav kawm yam tsis muaj kev hloov kho tus thawj qhov chaws. Hauv AngularJS , kho kom zoo nkauj yog cov haujlwm uas tso cai rau kev pabcuam, kev qhia lossis lim kom hloov kho ua ntej nws siv.

Ua raws li qhov no hauv kev xav, dab tsi yog cov khoom hauv angular 4?

Cheebtsam zoo li lub tsev thaiv hauv ib qho Angular daim ntawv thov. Cheebtsam yog txhais siv tus @component decorator. Ib tug tivthaiv muaj ib tug selector, template, style thiab lwm yam khoom, siv uas nws qhia cov metadata yuav tsum tau ua cov khoom.

Dab tsi yog structural directive nyob rau hauv angular?

Cov lus qhia kev tsim qauv yog lub luag haujlwm rau HTML layout. Lawv tsim los yog hloov kho DOM's qauv , feem ntau yog los ntawm kev ntxiv, tshem tawm, lossis tswj cov ntsiab lus. Raws li nrog rau lwm yam cov lus qhia , koj thov a kev coj ua qauv mus rau lub host element. Txhua kev coj ua qauv ua ib yam dab tsi txawv nrog tus qauv ntawd.

Pom zoo: