1
我想将CSS应用于指令元素,但以下示例不起作用。有什么建议么?是否可以将CSS应用于指令元素?
指令:
app.directive('test', function() {
return {
restrict: 'E',
templateUrl: 'test.html'
};
});
的test.html:
<div></div>
的index.html:
<body>
<test></test>
</body>
CSS:
test {
width: 100px;
height: 100px;
background-color: yellow;
}
感谢您对答案的链接和其它详细信息。 –