Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced FaIconLibrary managed by Angular #168

Merged
merged 2 commits into from
Aug 11, 2019

Conversation

devoto13
Copy link
Collaborator

Usage:

export class AppModule {
  constructor(library: FaIconLibrary) {
    library.addIcons(faCoffee);
  }
}

Using DI instead of the syntax discussed in the issue
(FontAwesomeModule.withIcons(faUser)) as this is more flexible and
future proof given that future version of Angular renderer (Ivy) is
going make usage of modules optional.


Deprecated using library from @fortawesome/fontawesome-svg-core in
favor of the new class. Previous library was problematic in several
ways:

  • global variable, which was shared by all code on the page
  • more complicated for consumers as they need to know about existence of
    fontawesome-svg-core and that it is used by angular-fontawesome
  • library from fontawesome-svg-core implementation was pretty complex

This deprecation is the first step on the way to make
fontawesome-svg-core an implementation detail of
angular-fontawesome, which consumers don't need to be aware about.

Fixes #3

To provide a better name and in preparation to introduce more
configuration options.
Usage:

```
export class AppModule {
  constructor(library: FaIconLibrary) {
    library.addIcons(faCoffee);
  }
}
```

Using DI instead of the syntax discussed in the issue
(`FontAwesomeModule.withIcons(faUser)`) as this is more flexible and
future proof given that future version of Angular renderer (Ivy) is
going make usage of modules optional.

---

Deprecated using library from `@fortawesome/fontawesome-svg-core` in
favor of the new class. Previous library was problematic in several
ways:

- global variable, which was shared by all code on the page
- more complicated for consumers as they need to know about existence of
`fontawesome-svg-core` and that it is used by `angular-fontawesome`
- library from `fontawesome-svg-core` implementation was pretty complex

This deprecation is the first step on the way to make
`fontawesome-svg-core` an implementation detail of
`angular-fontawesome`, which consumers don't need to be aware about.

Fixes FortAwesome#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: API to register icons
1 participant