Cho*_*c13 3 angularjs glyphicons angular-bootstrap
我正在使用Yeoman和cg-angular生成器来构建一个角度应用程序.这最初工作正常,但我最近升级angular-bootstrap,从0.10以0.11获得关于模态大小的一个新功能的保持.执行此操作后,我注意到Chrome上的开发人员控制台中出现以下错误.
GET http://localhost:9001/fonts/glyphicons-halflings-regular.woff angular-ui-router.js:3702
GET http://localhost:9001/fonts/glyphicons-halflings-regular.ttf :9001/fonts/glyphicons-halflings-regular.ttf:1
Run Code Online (Sandbox Code Playgroud)
我使用的版本3.1.1的bootstrap.
如果我升级bootstrap到最新的那个3.3.4.然后我得到一些不同的错误:
GET http://fonts/glyphicons-halflings-regular.woff2 net::ERR_NAME_NOT_RESOLVED angular-animate.js:442
GET http://fonts/glyphicons-halflings-regular.woff net::ERR_NAME_NOT_RESOLVED fonts/glyphicons-halflings-regular.woff:1
GET http://fonts/glyphicons-halflings-regular.ttf net::ERR_NAME_NOT_RESOLVED fonts/glyphicons-halflings-regular.ttf:1
Run Code Online (Sandbox Code Playgroud)
我应该说我在本地运行时看到这些错误 grunt serve
此外,如果我升级boostrap,但保持angular-bootstrap在0.10那时我没有这些问题.
我也有以下我的Gruntfile.js:
copy: {
main: {
files: [
{src: ['bower_components/font-awesome/fonts/**'], dest: 'dist/', filter: 'isFile', expand: true},
{src: ['bower_components/bootstrap/fonts/**'], dest: 'dist/', filter: 'isFile', expand: true}
]
}
}
Run Code Online (Sandbox Code Playgroud)
虽然,就像我说的那样,我在本地运行时看到这些丢失的字形,所以这个笨拙的任务不应该进入游戏.
我已经仔细研究了angular-bootstrap代码,令人困惑的是,代码中似乎没有直接引用glyphicon字体,因此升级此模块可能会导致这些错误有点奇怪.
升级时有没有其他人对glyphicons有任何问题angular-bootstrap?
当您运行站点时,浏览器中的编译越少,grunt serve因此fonts(../fonts/)的默认路径与bootstrap less文件无关.要修复它只是覆盖字体路径(app.less默认情况下)
@icon-font-path: "bower_components/bootstrap/fonts/";
Run Code Online (Sandbox Code Playgroud)
也许在angular-bootstrap中的东西开始在0.11中使用glyphicons,这就是为什么你在升级后看到这个.
| 归档时间: |
|
| 查看次数: |
6454 次 |
| 最近记录: |