JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2840
  • Score
    100M100P100Q116427F
  • License MIT

Angular service to set the favicon of a site, and an alternative one for dark mode

Package Exports

  • angular-favicon
  • angular-favicon/bundles/angular-favicon.umd.js
  • angular-favicon/fesm2015/angular-favicon.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular-favicon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

downloads license code style: prettier

Angular Favicon

Use this Angular service to set the favicon of a site.

You can also set an alternative favicon. This second favicon will be automatically shown when the browser/OS theme is set (or switches!) to dark mode.

Usage

Install via npm:

npm install --save angular-favicon

Use it anywhere in your project:

import { Component, OnInit } from '@angular/core';
import { AngularFaviconService } from 'angular-favicon';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  constructor(private ngxFavicon: AngularFaviconService) {}

  ngOnInit() {
    this.ngxFavicon.setFavicon(favicon_url);
    // OR 
    this.ngxFavicon.setFavicon(favicon_url, alt_favicon_url);
  }
}