Getting started with nxt-flags
Installing
npm install --save nxt-flagsImport flags module
import { FlagsModule } from 'nxt-flags'
@NgModule({
...
imports: [
...
FlagsModule
]
})Add flags SVGs to Angular compilation
{
...
"assets": [
...,
{
"glob": "**/*",
"input": "./node_modules/nxt-flags/assets/flags",
"output": "./assets/flags"
}
]
}Include it in HTML template
Use the tag nxt-flag with attribute country="xx" (where xx is the ISO 3166-1-alpha-2 code of a country):
<nxt-flag country="br"></nxt-flag>Configuration options
| Input | Type | Default value | Description |
|---|---|---|---|
| [country] | FlagDatabaseKey | undefined | ISO 3166-1-alpha-2 country code |
| [format] | FlagFormat | 'none' | Flag format |
| [size] | number | FlagSizeAlias | 48 | Flag width, either value in pixels or FlagSizeAlias |
nxt-components