angularjs - SVG directive: css class added but not applied -
[resolved]
I used 1.3-beta using a simple SVG directive The "SVG" code is direct for instructions (see Plunker - updated with solution):
- Create a SVG element with the class
- When the class Is clicked, then a square is added to it (fill it with red)
- Points: The class is correctly added to the SVG class element,
Here is the JS part: Directive ('SVG Directive', function () {Returns {Template: '& lt; svg xmlns: xlink = "Http: //www.w3.org/1999/xlink"> and CSS:
. Selected {fill: '# f00'; - & gt; Solution: No quotation marks: Fill: #F00; }
There is an error in your css file, you have specified the fill color in quotation marks. Where no one should be. Change the CSS with the following code and your example is working as intended:
. Selected {fill: # f00; }
Also keep in mind that if you use jQuery as your AngularJS backend, then adding CSS class may be impossible ()
Comments
Post a Comment