Add svg prefix to avoid future name collision
This commit is contained in:
32
src/components/svg-module.component.ts
Normal file
32
src/components/svg-module.component.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Component, OnInit, Input} from 'angular2/core';
|
||||
|
||||
import {SvgKeyboardKey} from './svg-keyboard-key.model';
|
||||
import {SvgKeyboardKeyComponent} from './svg-keyboard-key.component';
|
||||
|
||||
@Component({
|
||||
selector: 'g[svg-module]',
|
||||
template:
|
||||
`
|
||||
<svg:path *ngFor="#path of coverages" [attr.d]="path.$.d"/>
|
||||
<svg:g svg-keyboard-key *ngFor="#key of keyboardKeys"
|
||||
[id]="key.id"
|
||||
[rx]="key.rx" [ry]="key.ry"
|
||||
[width]="key.width" [height]="key.height"
|
||||
[attr.transform]="'translate(' + key.x + ' ' + key.y + ')'"
|
||||
/>
|
||||
`,
|
||||
directives: [SvgKeyboardKeyComponent]
|
||||
})
|
||||
export class SvgModuleComponent implements OnInit {
|
||||
@Input() coverages: any[];
|
||||
@Input() keyboardKeys: SvgKeyboardKey[];
|
||||
|
||||
constructor() {
|
||||
this.keyboardKeys = [];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user