【发布时间】:2013-11-15 16:15:16
【问题描述】:
我正在尝试创建将在 svg 元素中使用的 AngularJS 指令。
该指令不创建 svg 元素,但使用存在一个。
我可以在开发工具中看到正确的 svg 标记,但浏览器没有显示它。
这是指令:
angular.module('ui.directives', []).directive('svgText',
function() {
return {
restrict: 'E',
replace: true,
template: '<text fill="green" x="4" y="20" font-weight="bolder" font-size="2" font-family="Arial">89</text>'
};
}
);
【问题讨论】: