I have just started to work on an app in Codeigniter with AngularJS. I want to use font-awesome offline but can't make it to work. I suspect the file folder structure of my application which is:
CI-AJS-APP
-app
-application
-assets
-css
-font-awesome
-font-awesome.css
-font
-js
-system
...
Now in my font-awesome.css file I have a reference to the fonts folder as:
@font-face {
font-family: "FontAwesome";
src: url('font/fontawesome-webfont.eot');
src: url('font/fontawesome-webfont.eot?#iefix') format('eot'),
url('font/fontawesome-webfont.woff') format('woff'),
url('font/fontawesome-webfont.ttf') format('truetype'),
url('font/fontawesome-webfont.svg#FontAwesome')
format('svg');
font-weight: normal;
font-style: normal;
}
In my application header I have included the font-awesome.css file as:
<link rel="stylesheet" href="<?php echo base_url();?>assets/
font-awesome/font-awesome.css">
I have not fully integrated AngularJS in CI however just for a page or two on which I want to show the font-awesome icons.
Any kind of help will be much appreciated.
Well I have found that file structure is alright. The reason for the problem was that I was using ng-class the wrong way.
This is what I was doing...
ng-class="{{fa fa-sort-asc}}"
But I found that the correct way to achieve this is...
ng-class="{{'fa fa-sort-asc'}}"
Notice the missing single quotes with the classname in the former code.
So, this mistake was not displaying the font-awesome icon at all in the browser.
Hope will be helpful to some out there :-).