forked from FortAwesome/angular-fontawesome
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
51 lines (45 loc) · 1.49 KB
/
config.ts
File metadata and controls
51 lines (45 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Injectable } from '@angular/core';
import { config } from '@fortawesome/fontawesome-svg-core';
import { IconDefinition, IconPrefix } from './types';
@Injectable({ providedIn: 'root' })
export class FaConfig {
/**
* Default prefix to use, when one is not provided with the icon name.
*
* @default 'fas'
*/
defaultPrefix: IconPrefix = 'fas';
/**
* Provides a fallback icon to use whilst main icon is being loaded asynchronously.
* When value is null, then fa-icon component will throw an error if icon input is missing.
* When value is not null, then the provided icon will be used as a fallback icon if icon input is missing.
*
* @default null
*/
fallbackIcon: IconDefinition | null = null;
/**
* Set icons to the same fixed width.
*
* @see {@link: https://fontawesome.com/how-to-use/on-the-web/styling/fixed-width-icons}
* @default false
*/
fixedWidth?: boolean;
/**
* Automatically add Font Awesome styles to the document when icon is rendered.
*
* For the majority of the cases the automatically added CSS is sufficient,
* please refer to the linked guide for more information on when to disable
* this feature.
*
* @see {@link: https://github.com/FortAwesome/angular-fontawesome/blob/main/docs/guide/adding-css.md}
* @default true
*/
set autoAddCss(value: boolean) {
config.autoAddCss = value;
this._autoAddCss = value;
}
get autoAddCss() {
return this._autoAddCss;
}
private _autoAddCss = true;
}