Angular component to show country flags.
Install the package with NPM:
$ npm install ngx-flags
Import the module to app.module.ts:
import { NgxFlagsModule } from 'ngx-flags';
@NgModule({
...
imports: [
...,
NgxFlagsModule,
...
],
...
})
Add this lines to angular.json
:
{
...
"assets": [
...,
{
"glob": "**/*",
"input": "./node_modules/ngx-flags/img/flags",
"output": "./assets/flags"
}
].
...
}
Use the tag flag
with attribute country="xx"
(where xx
is the
ISO 3166-1-alpha-2 code
of a country):
<flag country="br"></flag>
attribute | options | default | description |
---|---|---|---|
size | 'xxs' , 'xs' , 's' , 'm' , 'l' , 'xl' , 'xxl' , |
48 |
sets the flag width |
format | 'none' , 'round' , 'square' |
'none' |
sets the flag format |
class | apply custom class to flag |
- [NEW] Added Wales (gb-wls, wls, wales)
- [FIX #2] Flag for GB/UK was mapped wrongly.
- [FIX] Fixed bug that prevented the flag to be shown under certain circumstances.