angular-fontawesome
http://picardy.github.io/angular-fontawesome/demo/
A simple directive for FontAwesome icons. Avoid writing a massive ngStyle
declaration for your FontAwesome integration, and use the power of Angular to make interactive icon-based widgets.
Usage
-
Include the FontAwesome CSS and fonts in your application by following their instructions.
-
Include the angular-fontawesome module in your Angular app.
angular -
Use the directive on any page which bootstraps your app.
<!-- $scope.checkColor = 'blue' --><!-- rendered -->
Attributes
The fa
directive's attributes map to the classes used by FontAwesome.
name
The icon's name, such as fa-spinner
or fa-square
.
<!-- rendered -->
alt
For accessibility support, you can now add an alt attribute, which will add a screen-reader friendly replacement text.
<!-- rendered -->github website
notice: the 'sr-only' class will hide the text from anyone not using a screen reader. It is derived from Bootstrap, so if you're not using Bootstrap, you must add this style to your css:
size
The icon's font size, either defined by a multiplier (1-5), or by the string "large"
.
<!-- $scope.currentSize = 3 --><!-- rendered -->
flip
Flip the icon horizontal
or vertical
.
<!-- rendered -->
rotate
Rotate the icon 90
, 180
, or 270
degrees.
<!-- rendered -->
spin
Animate the icon to spin. You don't need to provide true to use the boolean attributes:
<!-- rendered -->
You can pass in true
or false
to the attribute as well, allowing the spin class to be be easily toggleable.
<!-- rendered -->
border
<!-- rendered -->
fixed width
<!-- rendered -->
inverse
<!-- rendered -->
list
This directive autodetects if you're setup to do fa-li
and then takes care of it for you.
Text here <!-- rendered --> Text here <!-- <fa>s that aren't the first <fa> in the <li> do not automatically get the fa-li class -->
stack
The faStack
directive is used as a wrapper for stacked fonts used by FontAwesome.
When using as a wrapper, you must also specify the 'stack' attribute on the children, as described here. Failure to do so will render the fonts, just not one on top of another like we want them to.
TODO
fa-stack
testspull="left"
,pull="right"
- full browser support list
License
MIT Licensed by Picardy.