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

Fix svg name #66

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/ngx-fast-icon-demo/src/app/comparison/ant/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ export const account: IconDefinition = {
theme: 'fill',
};

export const us: IconDefinition = {
icon: `<svg id="us" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2a7.2 7.2 0 01-6-3.22c.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08a7.2 7.2 0 01-6 3.22z"></path></svg>
`,
name: 'us',
theme: 'fill',
};

export const back: IconDefinition = {
icon: `<svg id="back" viewBox="0 0 448 512" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path
d="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"></path></svg>
Expand Down Expand Up @@ -2505,6 +2513,7 @@ export const workshops = {

export const AllIcons = [
account,
us,
back,
consulting,
custom_workshops_1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class FontAwesomeComponent {
faCircleUser,
faCircleUser,
faCircleUser,
faCircleUser,
]);
}
}
1 change: 1 addition & 0 deletions packages/ngx-fast-icon-demo/src/app/icon-data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const SUPPORTED_ICONS = [
'account',
'us',
'back',
'genre',
'imdb',
Expand Down
2 changes: 2 additions & 0 deletions packages/ngx-fast-icon-demo/src/assets/svg-icons/us.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/ngx-fast-lib/src/lib/fast-svg.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class FastSvgComponent implements AfterViewInit, OnDestroy {
// If the img is present
// and the name in included in the href (svg is fully loaded, not only the suspense svg)
// Remove the element from the DOM as it is no longer needed
if (cache.name.includes(this.name)) {
if (cache.name === `#${this.name}`) {
img.removeEventListener('load', this.loadedListener);
// removeEventListener.bind(img, 'load', this.loadedListener);
img.remove();
Expand Down