Open Jakobovski opened 10 years ago
The generator uses Font Awesome by default. Did you undo that?
You'll need to make sure the glyphicons font is copied over. You'll likely also need to change the bootstrap LESS var for the icon path. By default I think that path is ../fonts
which is causing your problem. You just need to make sure the relative location of the fonts to the css file is the same as the relative pathing is in development.
I did not change the default font from Font Awesome. They only thing that is not default in my build is the use of ui-router
.
Your suggested fix solved my issue, thanks! It would still be nice to get this to work out of the box.
Out of the box it uses Font Awesome. Font Awesome is a replacement for glyphicons in bootstrap. If you've using glyphicons instead of Font Awesome icons you'll get an error like this (but you'll see it regardless of the dist build or just running from the development files).
Alright... Can I add that bootstrap glyphicons are not supported to the README?
So what is the recommended fix for this. Not to use font-icons with angular bootstrap or not to use glyphicons ?
Anyone have a fix for this? After build, our project is still looking for the bootstrap-sass glyphicons to root/bower_components instead of the dist folder.
bootstrap-sass? Thats not part of this generator (yet). If you have some stylesheet thats referencing a font, you need to ensure that the font file is copied to /dist during the build and that the relative location of that font to the css file is the same as it was in the original dev environment.
You should be using bootstrap-sass-official, which is the official sass port of Bootstrap.
I've had to add this my Gruntfile.js to get rid of this error:
grunt.initConfig > copy > main > files >
{src: ['bower_components/bootstrap/fonts/**'], dest: 'dist/',filter:'isFile',expand:true}
Should not have to do this out of the box.
I just realized that we always use our custom TWBS so we change the icons back to glyphicons. So technically, out of the box this error does not occur.
So you can reject this PR but I agree with Jakobovski, there should be something added to the README that states that is you use native TWBS then you have to make the addition to the Gruntfile.
Personally, although I think FontAwesome is indeed awesome, hacking Twitter Bootstrap out of the box is an unfortunate decision.
Chris, can you close this issue since you merged my PR in 5b4a9c894 ?
Is it mentioned anywhere in the README or anywhere else that the purpose of font awesome is to replace the glyphicons font?
When we initially generated our project, we saw the reference to font awesome, but we removed it because I didn't understand why it was there.
I still get the 404 error if I implement some of the angular-bootstrap components (like a datepicker). I have {src: ['bower_components/bootstrap/fonts/**'], dest: 'dist/',filter:'isFile',expand:true} in my gruntfile. Can anyone confirm this is still happening if u implement such a component?
@kennethvdberghe same problem while working with datepicker
@kennethvdberghe yes, it still happening.
If your web server is IIS try this method: Go in to the IIS console, click MIME Types icon and add .woff as application/octet-stream – problem solved!
you need to register Mime types for .woff files. in IIS server see this http://projectseven.com/tutorials/servers/iis-woff/index.htm
After grunt build the CSS file tries to find
glyphicons-halflings-regular.woff
infonts/
instead of inbower_components/
. I am therefore getting a 404 errorGET http://localhost:9001/fonts/glyphicons-halflings-regular.woff 404 (Not Found)
See similar issue: See https://github.com/yeoman/generator-angular/issues/665