小编pd *_*had的帖子

错误:XHR错误(404 Not Found)加载angular2/http

我正在为我的Angular2应用程序使用angular-cli.每当我尝试在我的组件/服务中加载angular2/http时,cli终端中没有显示错误,但是在我的浏览器控制台中它显示了这个 -

获取http:// localhost:4200/angular2/http 404(未找到)

未处理的Promise拒绝:错误:XHR错误(404 Not Found) 在XMLHttpRequest.desc.set.wrapFn [as_onreadystatechange]上加载http:// localhost:4200/angular2/http(http:// localhost:4200/vendor/zone. js/dist/zone.js:769:30)在Zone.runTask的ZoneDelegate.invokeTask(http:// localhost:4200/vendor/zone.js/dist/zone.js:356:38)(http:// localhost:4200/vendor/zone.js/dist/zone.js:256:48)在XMLHttpRequest.ZoneTask.invoke(http:// localhost:4200/vendor/zone.js/dist/zone.js:423:34))从http:// localhost:4200/app/js-tree.component.js加载http:// localhost:4200/angular2/http为"angular2/http"时 出错 ; 区域:; 任务:Promise.then; 值:错误:错误:XHR错误(404 Not Found) 在XMLHttpRequest.desc.set.wrapFn [as_onreadystatechange](http:// localhost:4200/vendor/zone)上加载 http:// localhost:4200/angular2/http . js/dist/zone.js:769:30)在Zone.runTask的ZoneDelegate.invokeTask(http:// localhost:4200/vendor/zone.js/dist/zone.js:356:38)(http:// localhost:4200/vendor/zone.js/dist/zone.js:256:48)在XMLHttpRequest.ZoneTask.invoke(http:// localhost:4200/vendor/zone.js/dist/zone.js:423:34))从http:// localhost:4200/app/js-tree.component.js加载http:// localhost:4200/angular2/http为"angular2/http"时 出错

我的angular-cli版本是0.0.39

节点:4.2.2

这是我的system-config.ts

const map: any = {
};

/** User packages configuration. */ …
Run Code Online (Sandbox Code Playgroud)

angular2-http angular-cli angular

12
推荐指数
2
解决办法
4万
查看次数

想要在Angular 2中路由时阻止组件重新创建

比方说,我们有两个途径DashboardProfile.Dashboard有动态标签功能Google spreadsheet.我想做一些交互(构建图表,可视化一些数据)创建标签Dashboard.现在,如果我路由到Profile然后路由回去Dashboard,我想看看之前在那些标签中的内容Dashboard.这意味着,我想在客户端保持状态.AFAIK在组件之间进行路由时,会重新创建组件.是否可以在使用角度2路由时制作类似应用程序的电子表格?我需要使用路由,因为在我的应用程序中我必须使用LazyLoading功能.

那么这个想法应该是什么?我是角度2的新手.

angular2-routing angular2-router3 angular

12
推荐指数
1
解决办法
6460
查看次数

第三方jquery-ui安装angular-cli

我正在为angular2项目使用angular-cli.在我的项目中,我想使用jquery-ui.我安装了jquery-ui

npm install jquery jquery-ui
Run Code Online (Sandbox Code Playgroud)

我编辑了我的angular-cli-build.js

module.exports = function(defaults) {
  return new Angular2App(defaults, {
    vendorNpmFiles: [
          'jquery/src/jquery.js',
          'jquery-ui/jquery-ui.js'
    ]
  });
};
Run Code Online (Sandbox Code Playgroud)

它将如何在我的dist/vendor文件夹中自动更新,我是否需要在我的index.html中添加css文件(如css/jquery-ui.css)?

我已经跟随了这个链接的时刻.js 但它没有帮助jquery-ui.我将欣赏jquery-ui与angular-cli集成的一个工作示例

jquery-ui angular-cli angular

6
推荐指数
1
解决办法
2913
查看次数

熊猫列值到行值

我有一个数据集(171 列),当我将它放入我的数据框中时,它看起来像这样-

ANO MNO UJ2010  DJ2010   UF2010 DF2010   UM2010 DM2010    UA2010    DA2010 ...
1   A   113   06/01/2010    129 06/02/2010  143 06/03/2010  209 05/04/2010 ...
2   B   218   06/01/2010    211 06/02/2010  244 06/03/2010  348 05/04/2010 ...
3   C   22    06/01/2010    114 06/02/2010  100 06/03/2010  151 05/04/2010 ...
Run Code Online (Sandbox Code Playgroud)

现在我想像这样改变我的数据框 -

    ANO MNO Time        Unit
    1   A   06/01/2010  113
    1   A   06/02/2010  129
    1   A   06/03/2010  143
    2   B   06/01/2010  218
    2   B   06/02/2010  211
    2   B   06/03/2010  244
    3   C   06/01/2010  22 …
Run Code Online (Sandbox Code Playgroud)

python numpy pandas jupyter jupyter-notebook

5
推荐指数
1
解决办法
1475
查看次数

如果用户未登录Angular2 2.0.0-rc.4,则重定向到登录路由

这是我的html文件

<div class="container">
  <h1>Dohatec Data</h1>
  <div class="navLinks">
    <a [routerLink]="['/home']">Home</a>&nbsp;
    <a [routerLink]="['/about']">About-Us </a>&nbsp;
    <a [routerLink]="['/price']">Pricing</a>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这是我的RouterConfig.

const routes: RouterConfig = [
  { path: '', redirectTo: 'home', terminal: true },
  { path: 'home', component: HomeComponent },
  { path: 'about', component: AboutUsComponent },
  { path: 'price', component: PriceComponent },
  { path: 'login', component: LoginComponent }
];
Run Code Online (Sandbox Code Playgroud)

如果用户未登录/ home路由,我想重定向用户.我可以在RouterConfig中完成吗?我不想使用, canActivate: [LoggedInGuard]因为它限制在路线之前

angular2-routing angular

4
推荐指数
1
解决办法
8223
查看次数

将数据帧列转换为计数器矩阵

我有一个这样的数据框。发票转换为一个表,其中每行都有一个产品。该表由数百万行组成 -

发票 产品
INVC1 xx
INVC1 yy
INVC1 Z Z
INVC1
INVC2 xx
INVC2
INVC2 BB
INVC2 抄送

现在我想创建一个如下所示的表格,在其中我可以看到每种产品与其他产品一起购买的次数 -

xx yy Z Z BB 抄送
xx 0 1 1 2 1 1
yy 1 0 1 1 0 0
Z Z 1 1 0 1 0 0
2 1 1 0 1 1
BB 1 0 0 1 0 1
抄送 1 0 0 1 1 0

有没有 numpy/pandas 方法来创建这样的表?或者,有没有任何优化的方法来做到这一点。

python numpy dataframe pandas

1
推荐指数
1
解决办法
56
查看次数