Dab tsi yog router guard hauv angular?
Dab tsi yog router guard hauv angular?

Video: Dab tsi yog router guard hauv angular?

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

Cov Angular routers kev taw qhia zov tso cai los yog tshem tawm kev nkag mus rau qee qhov chaw ntawm kev navigation. Lwm txoj kev zov , CanDeactivate zov , txawm tso cai rau koj los tiv thaiv tus neeg siv los ntawm kev ua yuam kev tawm hauv ib feem nrog kev hloov pauv tsis tau txais kev cawmdim.

Ib yam li ib tug yuav nug, tus neeg saib xyuas router yog dab tsi?

Cov Router Guard yog cov khoom tshiab tshaj plaws uas thaiv thiab thaiv koj tus kheej thiab koj tsev neeg los ntawm EMF, electromagnetic teb, koj lub WiFi tawm 24 teev hauv ib hnub. Cov Router Guard yog ib qho kev cai Faraday tawb uas thaiv txog 90% ntawm EMF emitting los ntawm WiFi routers . Nws yooj yim rau nruab thiab tsis muaj kev sib dhos yuav tsum tau ua.

Qhov thib ob, koj tuaj yeem qhib txoj kev Guard? CanActivate txuas Interface uas yog chav kawm ua tau siv los ua ib zov kev txiav txim siab yog tias a txoj kev tuaj yeem ua qhib . Yog tag nrho zov rov qab muaj tseeb, navigation yuav txuas ntxiv. Yog muaj zov rov qab UrlTree, kev taw qhia tam sim no yuav raug muab tso tseg thiab ib tug tshiab navigation yuav raug ncaws tawm mus rau UrlTree rov qab los ntawm lub zov.

Tsis tas li ntawd, tuaj yeem qhib kev tiv thaiv hauv angular?

Txhais Guards Guards tuaj yeem yuav siv nyob rau hauv ntau txoj kev, tab sis tom qab tag nrho nws yeej boils rau muaj nuj nqi uas rov qab Observable, Promise los yog boolean. Ntxiv rau, zov tau sau npe siv cov chaw muab kev pabcuam, yog li lawv ua tau txhaj los ntawm Angular thaum xav tau.

Dab tsi yog cov neeg saib xyuas hauv angular 2?

Dab tsi yog cov Angular 2 Txoj kev Cov neeg saib xyuas thiab yuav ua li cas nrog lawv? Raws li lub npe qhia, koj tuaj yeem teeb tsa zov ntawm txoj hauv kev hauv koj daim ntawv thov kom tswj tau li cas tus neeg siv navigates ntawm lawv. Cov no yog cov haujlwm hu ua thaum router sim qhib lossis deactivate qee txoj kev.

Pom zoo: