Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
Fix typing of setSVGAttributes (closes #116)
Browse files Browse the repository at this point in the history
  • Loading branch information
echeung-amzn committed Aug 25, 2019
1 parent 6fef142 commit f5caeee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The SVG file (if found) will be inserted *inside* the element with the `[inlineS
| prepend | boolean | `false` | Inserts before the first child instead of appending, overwrites `replaceContents` |
| replaceContents | boolean | `true` | Replaces the contents of the element with the SVG instead of just appending it to its children. |
| injectComponent | boolean | `false` | Injects an `<inline-svg>` component containing the SVG inside the element with the directive. |
| setSVGAttributes | `{ string: any }` | | Sets attributes on the SVG element. Runs after `removeSVGAttributes`. |
| setSVGAttributes | `{ [key: string]: any }` | | Sets attributes on the SVG element. Runs after `removeSVGAttributes`. |
| removeSVGAttributes | string[] | | An array of attribute names to remove from all child elements within the SVG. |
| forceEvalStyles | boolean | `false` | Forces embeded style tags' contents to be evaluated (for IE 11). |
| evalScripts | `'always'`, `'once'`, `'none'` | `'always'` | Whether to evaluate embedded scripts in the loaded SVG files. The `SVGScriptEvalMode` enum is also provided. |
Expand Down
2 changes: 1 addition & 1 deletion src/inline-svg.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class InlineSVGDirective implements OnInit, OnChanges, OnDestroy {
@Input() prepend: boolean = false;
@Input() injectComponent: boolean = false;
@Input() cacheSVG: boolean = true;
@Input() setSVGAttributes: { string: any };
@Input() setSVGAttributes: { [key: string]: any };
@Input() removeSVGAttributes: Array<string>;
@Input() forceEvalStyles: boolean = false;
@Input() evalScripts: SVGScriptEvalMode = SVGScriptEvalMode.ALWAYS;
Expand Down
2 changes: 1 addition & 1 deletion src/svg-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function removeAttributes(element: Element, attrs: Array<string>): void {
* @param element Element to set attributes on.
* @param attrs Attribute key/values.
*/
export function setAttributes(element: Element, attrs: { string: any }): void {
export function setAttributes(element: Element, attrs: { [key: string]: any }): void {
for (const attr in attrs) {
element.setAttribute(attr, attrs[attr]);
}
Expand Down

0 comments on commit f5caeee

Please sign in to comment.