【发布时间】:2016-09-13 21:07:03
【问题描述】:
我有简单的 angular2 组件:
import {Component} from 'angular2/core';
@Component({
selector: 'circle',
template: `<svg height="100" width="100">
<circle cx="50" cy="50" r="40" stroke="black"
stroke-width="3" fill="red" />
</svg>`,
})
export class Circle { }
我想使用组件的某些参数动态更改fill 属性,例如<circle color="red"></circle>,结果有红色圆圈。有可能吗?
【问题讨论】:
标签: svg angular angular2-directives