flag-icon-css for Angular 5+
<flag-icon country="fr" squared></flag-icon>
-
country (Input):
the ISO 3166-1-alpha-2 code of the flag's country -
squared (Input):
if added, will render a squared version of the flag
- Install both this library as well as flag-icon-css
npm install ngx-flag-icon-css flag-icon-css
- Add the path to the flag-icon-css stylesheet to your angular.json file (inside the "styles" entry)
Note: This key should still exist in the old .angular-cli.json format
"styles": [
"src/styles.css",
"node_modules/flag-icon-css/css/flag-icon.min.css"
],