Vim li cas lub hauv paus href hauv angular?

Cov txheej txheem:

Vim li cas lub hauv paus href hauv angular?
Vim li cas lub hauv paus href hauv angular?

Video: Vim li cas lub hauv paus href hauv angular?

Video: Vim li cas lub hauv paus href hauv angular?
Video: Wb zaj dab neeg sib hlub tsis tau (Full version) - ZAJ DUB nkauj tawm tshiab 2024, Lub peb hlis ntuj
Anonim

Angular ua rau siv lub hauv paus href qhia router yuav ua li cas sau URLs. Yog tias koj daim ntawv thov muaj nyob hauv paus, ces koj tuaj yeem siv / raws li tus nqi href raws li qhia hauv qab no. Kuv xav siv / cov neeg siv ua kuv daim ntawv thov hauv paus rau router thiab / pej xeem ua lub hauv paus rau kuv cov cuab tam.

Lub hom phiaj ntawm lub hauv paus href tag yog dab tsi?

Tus yam ntxwv href qhia lub hauv paus URL rau txhua tus txheeb ze URL ntawm nplooj ntawv.

BASE HREF yog dab tsi?

HTML Attribute

Qhia lub hauv paus URL uas yuav siv rau txhua tus txheeb ze txuas hauv daim ntawv tam sim no.

Puas yog BASE HREF tsim nyog?

Tsis yog lawv yuav tsis. HTML qhia meej tias qhov txheeb ze URLs raug daws li cas.

Dab tsi yog lub hauv paus hauv Angular Qhov twg peb yuav tsum tso nws?

Add the base element just after the tag. Yog tias lub app folder yog daim ntawv thov hauv paus, raws li nws yog rau peb daim ntawv thov, teeb tsa tus nqi href raws nraim li qhia ntawm no. Tus qhia Angular router dab tsi yog qhov zoo li qub ntawm URL.

Pom zoo: