How to include ui-grid font files into the project

前端 未结 8 673
独厮守ぢ
独厮守ぢ 2021-01-07 19:55

I have been stuck with anjularjs ui-grid, it\'s showing some Chinese symbols in place of icons. After digging about it I get to know I have to use some font-files provided b

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 20:24

    If you install ui grid using 'bower install' than the files should be installed in their proper location. The problem we had is that we're using ui-router, which requires all requests to be rewritten to index.html. We had to add the font extensions to our rewrite rules so that Angular could load them. We're using a middleware plugin for running locally. On Apache/Nginx server the concept is the same.

    middleware: function (connect) {
            return [
              modRewrite(['!\\.html|\\.js|\\.svg|\\.woff|\\.ttf|\\.eot|\\.css|\\.png$ /index.html [L]']),
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
    

提交回复
热议问题