(404未找到)加载http:// localhost:4200 / angular2-datatable / datatable [英] (404 Not Found) loading http://localhost:4200/angular2-datatable/datatable

查看:615
本文介绍了(404未找到)加载http:// localhost:4200 / angular2-datatable / datatable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用制作排序表。我遵循了这些说明,似乎我正确地安装了 angular2-datatable / datatable
但是在运行时,它抱怨说:

I am trying to make a sortable table using this. I have followed the instructions and it seems that, i have installed the angular2-datatable/datatable correctly. But in the run time it complains that:

 GET http://localhost:4200/angular2-datatable/datatable 404 (Not Found)

它来自以下行:

import {DataTableDirectives} from 'angular2-datatable/datatable';

但是我查看了 node_module 包,我有 angular2-datatable / datatable 那里。
所以看起来运行时的角度看起来错误的路径。
我如何解决?

But i checked the node_module package and i have angular2-datatable/datatable there. So it seems that angular in the runtime looks in the wrong path. How can i fix it?

推荐答案

更新 angular2-datatable > systemjs.config.js 像这样 -

Update angular2-datatable in your systemjs.config.js like this-

// map tells the System loader where to look for things
var map = {
    'src':                        'build', // 'dist',
    'rxjs':                       'node_modules/rxjs',
    '@angular':                   'node_modules/@angular',
    'angular2-datatable':         'node_modules/angular2-datatable',
    'lodash':                     'node_modules/lodash/lodash.js',
};

// packages tells the System loader how to load when no filename and/or no extension
var packages = {
    'src':                        { main: 'main.js',  defaultExtension: 'js' },
    'rxjs':                       { defaultExtension: 'js' },
    'angular2-datatable':         { defaultExtension: 'js' },
    'lodash':                     { defaultExtension: 'js' },
};

看看是否有帮助。

这篇关于(404未找到)加载http:// localhost:4200 / angular2-datatable / datatable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆