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):

  1. Create a SVG element with the class
  2. When the class Is clicked, then a square is added to it (fill it with red)
  3. 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"> , transclude: true, Type: 'svg', replace: true};}) .directive ('svgsequire', function () {return} {template: '

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 ()

< / Html>

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -