2017-03-04 71 views
0

几分钟前,我刚刚在我的angular 2应用程序中遇到404错误。在我的终端中没有错误,虽然我的控制台中有一些404错误。我在angular-cli.json文件的node_modules中包含了bootstrap。但是,我不知道未处理的承诺拒绝来自何处。任何想法如何解决这个问题?未处理的Promise拒绝Angular 2中的

enter image description here

**404 error** 

     Unhandled Promise rejection: Failed to load ../bootstrap/css/bootstrap.min.css ; Zone: <root> ; Task: Promise.then ; Value: Failed to load ../bootstrap/css/bootstrap.min.css undefined 

     ZoneAwareError {__zone_symbol__error: Error: Uncaught (in promise): Failed to load ../bootstrap/css/bootstrap.min.css 
      at resolvePromis…, rejection: "Failed to load ../bootstrap/css/bootstrap.min.css", promise: ZoneAwarePromise, zone: Zone, task: ZoneTask} 

    GET http://localhost:4200/css/local.css 404 (Not Found) 

**angular-cli** 
{ 
    "project": { 
    "version": "1.0.0-beta.28.3", 
    "name": "frontend" 
    }, 
    "apps": [ 
    { 
     "root": "src", 
     "outDir": "dist", 
     "assets": [ 
     "assets", 
     "favicon.ico" 
     ], 
     "index": "index.html", 
     "main": "main.ts", 
     "polyfills": "polyfills.ts", 
     "test": "test.ts", 
     "tsconfig": "tsconfig.json", 
     "prefix": "app", 
     "styles": [ 
     "styles.css", 
     "../node_modules/bootstrap/dist/css/bootstrap.min.css", 
     "../node_modules/font-awesome/css/font-awesome.min.css", 




     ], 
     "scripts": [ 





     ], 
     "environments": { 
     "source": "environments/environment.ts", 
     "dev": "environments/environment.ts", 
     "prod": "environments/environment.prod.ts" 
     } 
    } 
    ], 
    "e2e": { 
    "protractor": { 
     "config": "./protractor.conf.js" 
    } 
    }, 
    "lint": [ 
    { 
     "files": "src/**/*.ts", 
     "project": "src/tsconfig.json" 
    }, 
    { 
     "files": "e2e/**/*.ts", 
     "project": "e2e/tsconfig.json" 
    } 
    ], 
    "test": { 
    "karma": { 
     "config": "./karma.conf.js" 
    } 
    }, 
    "defaults": { 
    "styleExt": "css", 
    "prefixInterfaces": false, 
    "inline": { 
     "style": false, 
     "template": false 
    }, 
    "spec": { 
     "class": false, 
     "component": true, 
     "directive": true, 
     "module": false, 
     "pipe": true, 
     "service": true 
    } 
    } 
} 
+0

我想你是使用引导程序,它无法加载,因为文件夹路径不正确 –

+0

现在,我不知道它引用的引导文件路径。因为我没有任何其他bootstrap文件夹放在node_modules文件夹中的一个 – XamarinDevil

+0

您是否在您的应用程序中使用任何全局css文件或任何local.css? –

回答

1

你在你的app.dashboard.html如下犯的错误,

enter image description here

应为

enter image description here

相关问题