Getting started with nxt-flags

Installing

npm install --save nxt-flags

Import 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

InputTypeDefault valueDescription
[country]FlagDatabaseKeyundefined

ISO 3166-1-alpha-2 country code

[format]FlagFormat'none'

Flag format

[size]number | FlagSizeAlias48

Flag width, either value in pixels or FlagSizeAlias