Skip to content

Commit

Permalink
Merge pull request #164 from czeckd/ng19
Browse files Browse the repository at this point in the history
Update to ng19
  • Loading branch information
czeckd authored Nov 21, 2024
2 parents 838111a + 1c0a145 commit aaf812d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 27 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Angular SVG Icon
=========

The **angular-svg-icon** is an Angular 18 service and component that provides a
The **angular-svg-icon** is an Angular 19 service and component that provides a
means to inline SVG files to allow for them to be easily styled by CSS and code.

The service provides an icon registery that loads and caches a SVG indexed by
Expand All @@ -21,13 +21,14 @@ $ npm i angular-svg-icon --save

## Versions

The latest version of the package is for Angular 18.
The latest version of the package is for Angular 19.

:grey_exclamation: **BREAKING CHANGE**: as of [email protected], the package was converted to use
`inject` and `signal` from `@common/core` for improved performance. Thus method calls that are inputs
should be avoided. Inputs are now signal inputs.

**Note on earlier versions of Angular:**
- For Angular 18, use [email protected]
- For Angular 17, use [email protected]
- For Angular 16, use [email protected]
- For Angular 15, use [email protected]
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "svg-icon",
"description": "Angular 18 component and service for inlining SVGs allowing them to be easily styled with CSS.",
"version": "18.0.2",
"description": "Angular 19 component and service for inlining SVGs allowing them to be easily styled with CSS.",
"version": "19.0.0",
"repository": {
"type": "git",
"url": "https://github.com/czeckd/angular-svg-icon.git"
Expand All @@ -24,22 +24,22 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^18.0.2",
"@angular/common": "^18.0.2",
"@angular/compiler": "^18.0.2",
"@angular/core": "^18.0.2",
"@angular/forms": "^18.0.2",
"@angular/platform-browser": "^18.0.2",
"@angular/platform-browser-dynamic": "^18.0.2",
"@angular/router": "^18.0.2",
"@angular/animations": "^19.0.0",
"@angular/common": "^19.0.0",
"@angular/compiler": "^19.0.0",
"@angular/core": "^19.0.0",
"@angular/forms": "^19.0.0",
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"rxjs": "~6.6.3",
"tslib": "^2.3.1",
"zone.js": "~0.14.2"
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.3",
"@angular/cli": "^18.0.3",
"@angular/compiler-cli": "^18.0.2",
"@angular-devkit/build-angular": "^19.0.0",
"@angular/cli": "^19.0.0",
"@angular/compiler-cli": "^19.0.0",
"@types/jasmine": "~4.0.0",
"@types/node": "^12.11.1",
"jasmine-core": "~4.1.0",
Expand All @@ -49,7 +49,7 @@
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~5.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"ng-packagr": "^18.0.0",
"typescript": "~5.4.5"
"ng-packagr": "^19.0.0",
"typescript": "~5.6.3"
}
}
8 changes: 4 additions & 4 deletions projects/angular-svg-icon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-svg-icon",
"description": "Angular 18 component and service for inlining SVGs allowing them to be easily styled with CSS.",
"version": "18.0.2",
"description": "Angular 19 component and service for inlining SVGs allowing them to be easily styled with CSS.",
"version": "19.0.0",
"repository": {
"type": "git",
"url": "https://github.com/czeckd/angular-svg-icon.git"
Expand All @@ -14,8 +14,8 @@
"icon"
],
"peerDependencies": {
"@angular/core": ">=18.0.0",
"@angular/common": ">=18.0.0",
"@angular/core": ">=19.0.0",
"@angular/common": ">=19.0.0",
"rxjs": ">=6.6.3"
},
"dependencies": {
Expand Down
5 changes: 1 addition & 4 deletions projects/angular-svg-icon/src/lib/svg-icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ export class SvgIconComponent implements OnDestroy {
this.destroy();
this.init(this.src(), this.name());
}
}, {allowSignalWrites: true});
});

// Watch for viewBox changes
effect(() => {
const viewBox = this.viewBox();
if (!this.svg()) return;

this.updateViewBox(viewBox);
});

Expand Down Expand Up @@ -159,9 +158,7 @@ export class SvgIconComponent implements OnDestroy {
elem.innerHTML = '';
this.renderer.appendChild(elem, icon);
this.helper.loaded = true;

this.copyNgContentAttribute(elem, icon);

this.svg.update(x => x + 1);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/app/demo-app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FormsModule } from '@angular/forms';


@Component({
standalone: true,
imports: [SvgIconComponent, FormsModule, NgClass, JsonPipe],
selector: 'app-demo',
styleUrls: ['./demo-app.component.scss'],
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"esModuleInterop": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": "./",
Expand Down

0 comments on commit aaf812d

Please sign in to comment.