nga-svg
v17.1.0
Published
Angular svg viewer
Downloads
84
Maintainers
Readme
ngaSvg
ngaSvg is an Angular library that provides a directive to show svg content.
Installation
To install ngaSvg, run the following command in your terminal:
npm install nga-svg --save
Usage
<div [ngaSvg]="svgString"></div>
export class MyComponent {
// ...
svgString: '<svg> .... </svg>';
// ...
}
or use catch:
import { SvgService } from 'nga-svg';
export class MyComponent {
svgService = inject(SvgService);
// ...
ngOnInit(): void {
this.svgService.addSVG('name', '<svg> .... </svg>');
}
// ...
}
<div ngaSvg svgName="name"></div>
or use input and catch
<div [ngaSvg]="svgString" svgName="test"></div>
export class MyComponent {
// ...
svgString: '<svg> .... </svg>';
// ...
}
Contributing
We welcome contributions to ngaSvg. Please feel free to create an issue or pull request on GitHub.
License
ngaSvg is licensed under the MIT License.