Dab tsi yog angular router?
Dab tsi yog angular router?

Video: Dab tsi yog angular router?

Video: Dab tsi yog angular router?
Video: Mob raum yog mob li cas thiab yuav muab tshuaj dab tsi kho ? | POVYANG 2024, Kaum ib hlis
Anonim

Cov Angular Router yog ib qho kev xaiv xaiv uas nthuav tawm cov ntsiab lus tshwj xeeb saib rau qhov muab URL. Nws tsis yog ib feem ntawm Angular tub ntxhais. Nws yog nyob rau hauv nws tus kheej lub tsev qiv ntawv pob, @ lub kaum sab xis / router . Ntshuam yam koj xav tau los ntawm nws raws li koj xav tau los ntawm lwm yam Angular pob.

Ua raws li qhov kev pom no, angular routing yog dab tsi?

Hauv AngularJS , txoj kev yog dab tsi tso cai rau koj los tsim ib nplooj ntawv thov. AngularJS txoj kev pab kom koj tsim cov URLs sib txawv rau cov ntsiab lus sib txawv hauv koj daim ntawv thov. AngularJS txoj kev tso cai rau ib qho los qhia ntau yam ntsiab lus nyob ntawm qhov twg txoj kev yog xaiv. A txoj kev yog teev nyob rau hauv qhov URL tom qab kos npe #.

Ib yam li ntawd, vim li cas routing yog siv nyob rau hauv angular? Cov Angular Router tso cai rau koj los qhia cov khoom sib txawv thiab cov ntaub ntawv rau tus neeg siv raws li qhov uas tus neeg siv nyob hauv daim ntawv thov. Cov router enables navigation los ntawm ib tug saib mus rau lwm yam raws li cov neeg siv ua hauj lwm xws li cov hauv qab no: Nkag mus rau ib tug URL nyob rau hauv qhov chaw nyob bar mus rau ib tug sib thooj nplooj.

Tsis tas li ntawd, dab tsi yog router qhov hluav taws xob hauv angular?

Router - qhov hluav taws xob hauv Angular ua hauj lwm raws li ib tug placeholder uas yog siv los thauj cov sib txawv Cheebtsam dynamically raws li activated tivthaiv los yog tam sim no txoj kev lub xeev. Navigation tuaj yeem ua tiav siv router - qhov hluav taws xob cov lus qhia thiab cov khoom siv ua haujlwm yuav muaj nyob rau hauv router - qhov hluav taws xob mus thauj nws cov ntsiab lus.

Koj puas xav ntxiv angular routing?

Saib lub kaum sab xis .io/cov/ router kom paub meej ntxiv txog txoj kev hauv Angular . Yog koj hais tias "Yog" ces CLI yuav cia li ntxiv router configuration rau koj qhov project. Angular txoj kev enables navigation los ntawm ib saib mus rau lwm tus raws li cov neeg siv ua hauj lwm. Nws yuav taug kev (nrhiav) koj raws li koj cov lus qhia.

Pom zoo: