2015-07-19 68 views
1

我按照此documentation使用BootStrap日期選擇器。如何從AngularJS的自定義URL中獲取字體?

這是我的HTML頭:

<!--jquery & jquery cookie--> 
    <script src="/node_modules/jquery/dist/jquery.min.js"></script> 
    <script src="/node_modules/jquery-cookie/jquery.cookie.js"></script> 

    <!--bootstrap--> 
    <script src="/node_modules/bootstrap/dist/js/bootstrap.min.js"></script> 
    <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css"> 

    <!--font-awesome--> 
    <link rel="stylesheet" href="/node_modules/font-awesome/css/font-awesome.min.css"> 

    <!--summernote--> 
    <link rel="stylesheet" href="/node_modules/summernote/dist/summernote.css"> 
    <link rel="stylesheet" href="/node_modules/summernote/dist/summernote-bs3.css"> 
    <script src="/node_modules/summernote/dist/summernote.min.js"></script> 


    <!--angular--> 
    <!--Note: for debugging purpose use non-minified angular, need to use angular.min.js for production--> 
    <script src="/node_modules/angular/angular.js"></script> 
    <!--<script src="/node_modules/angular/angular.min.js"></script>--> 
    <script src="/node_modules/angular-resource/angular-resource.min.js"></script> 
    <script src="/node_modules/angular-route/angular-route.min.js"></script> 
    <script src="/node_modules/angular-sanitize/angular-sanitize.min.js"></script> 

    <!--angular-summernote--> 
    <script src="/node_modules/angular-summernote/dist/angular-summernote.min.js"></script> 


    <!--angular-bootstrap--> 
    <script src="/node_modules/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> 
    <link rel="stylesheet" href="/node_modules/angular-bootstrap/ui-bootstrap-csp.css"> 

當我添加了選擇器,我得到了以下錯誤:

jquery.js:5246 GET http://localhost:8888/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 (anonymous function) @ jquery.js:5246n.fn.extend.domManip @ jquery.js:5414n.fn.extend.after @ jquery.js:5244domInsert @ angular.js:5010$AnimateProvider.$get.enter @ angular.js:5173(anonymous function) @ angular.js:23761publicLinkFn @ angular.js:7408$get.boundTranscludeFn @ angular.js:7553controllersBoundTransclude @ angular.js:8169ngIfWatchAction @ angular.js:23752$get.Scope.$digest @ angular.js:15667$get.Scope.$apply @ angular.js:15935(anonymous function) @ angular.js:23244n.event.dispatch @ jquery.js:4435n.event.add.r.handle @ jquery.js:4121 
public/fonts/bootstrap/glyphicons-halflings-regular.woff:1 GET http://localhost:8888/public/fonts/bootstrap/glyphicons-halflings-regular.woff 
public/fonts/bootstrap/glyphicons-halflings-regular.ttf:1 GET http://localhost:8888/public/fonts/bootstrap/glyphicons-halflings-regular.ttf 

我沒有public/fonts/bootstrap文件夾,但我有一個靜態的路由器到node_modules/bootstrap文件夾。

如何在不移動文件夾的情況下使用它?

我的文件夾結構:

/root 
    /server 
     /blog 
    /client 
     /blog 
    /public 
     /script 
     /style 
     /image 
     /blog 
    /node_modules 
     /angular 
     /bootstrap 
     /etc 
+0

你能告訴您的文件夾結構? –

+0

@AvraamMavridis更新。字體文件位於node_modules/bootstrap/fonts – OMGPOP

+0

使用* bower *安裝東西並將安裝目錄設置爲_.bowerrc_文件http://bower.io/docs/config/ – sbaaaang

回答

1

你可能不超過引導字體複製。某些第三方庫假定字體存在於/public之下。

如果使用的是一飲而盡,這裏是一個虛工從node_modules複製字體public

gulp.task('copy:font', function() { 
    return gulp.src('/node_modules/bootstrap-sass/assets/fonts/**') 
     .pipe(gulp.dest('/public/fonts')) 
}) 
相關問題