Tabbas, ga dogon labarin game da Font Awesome Angular:
Font Awesome babban ษakin karatu ne na icon wanda za'a iya amfani dashi a cikin aikace-aikacen mu na Angular. Haษa Font Awesome yana ba masu haษaka damar zuwa ษaruruwan madaidaitan gumaka masu ฦima waษanda za a iya keษance su da CSS. Wannan yana da amfani musamman tunda yana ba mu damar amfani da gumaka masu kyau ba tare da buฦatar dogaro da yawa akan zane-zane ko fayilolin hoto ba. Wannan na iya sauฦaฦa da gaske kulawa da tsara ayyukan ku na Angular. A cikin wannan jagorar, za mu koyi yadda ake haษa Font Awesome cikin aikace-aikacen ku na Angular mataki-mataki.
Matsala da Magani:
A wasu lokuta a matsayinka na mai haษakawa, ฦila ka sami wahalar yin ma'amala da adadi mai yawa na hotuna da zane-zane lokacin da ake mu'amala da gumaka a cikin aikinku. Wannan ba wai kawai zai iya sa aikin ku ya lalace ba amma kuma yana iya shafar aikin ฦa'idar ku. Wannan shine inda Font Awesome ke shigowa.
Font Awesome yana sauฦaฦe wannan ta hanyar ba da faffadan gumaka da aka adana azaman fayil ษin rubutu.
// First you will need to install the font awesome library npm i @fortawesome/angular-fontawesome @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons // Next, import the fontawesome library in your app.module.ts file import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
Bayanin Code:
Kawai gudanar da npm shigar da umarni don fakitin Font Awesome a cikin tashar ku ko umarni da sauri don shigar da su a cikin aikin Angular ku.
Bayan an gama shigarwar, dole ne ka shigo da 'FontAwesomeModule' a cikin fayil ษin app.module.ts na aikin Angular ku.
Haษin kai Tare da Abubuwan Angular:
Mataki na gaba shine sanin kanku da yadda ake amfani da waษannan gumakan a cikin abubuwan haษin ku.
// Here's how to use the icons in your Angular component import {faCoffee} from '@fortawesome/free-solid-svg-icons'; export class AppComponent { faCoffee = faCoffee; }
Bayan shigo da gunkin, zaku iya amfani da shi a cikin abubuwan haษin ku kawai ta ฦara lambar mai zuwa a cikin fayil ษin HTML ษinku.
<fa-icon [icon]="faCoffee"></fa-icon>
Amfani da ฦarin Gumaka:
Akwai wasu fakiti da yawa daga Font Awesome waษanda zaku iya amfani da su don samun ฦarin gumaka.
npm i @fortawesome/free-brands-svg-icons @fortawesome/free-regular-svg-icons
Bayan shigar, zaku iya amfani da sabbin gumaka ta shigo da su cikin fayil ษin bangaren.
[b] A ฦarshe [/b], Font Awesome kayan aiki ne mai ban mamaki wanda zai iya haษaka abubuwan gani na aikace-aikacen ku na Angular. Yana da sauฦin amfani kuma yana ba da fa'idodi masu yawa akan amfani da hotuna ko zane-zane na gargajiya. Ko kai ฦwararren mai haษakawa ne ko kuma fara farawa da Angular, tabbas yakamata kuyi la'akari da haษa Font Awesome a cikin ayyukanku.
- Yana da sauฦin sarrafawa fiye da tarin hotuna
- Yana ba da babban tarin gumaka
- Yana taimakawa tare da aikin gidan yanar gizon
- Yana bayar da scalability ba tare da asarar inganci ba
- Yana ba da ikon CSS akan gumaka