小编maa*_*aac的帖子

Angular rxjs Observable.timer不是带导入的函数

在我的角度应用程序中,我收到以下错误:

ERROR TypeError:rxjs_Observable__WEBPACK_IMPORTED_MODULE_4 __.ObMapable.timer不是SwitchMapSubscriber.project(hybrid.effect.ts:20)中的函数,位于SwitchMapSubscriber.push ../ node_modules/rxjs/_esm5/internal/operators/switchMap.js.SwitchMapSubscriber._next( switchMap.js:34)在SwitchMapSubscriber.push ../ node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next(Subscriber.js:54)at FilterSubscriber.push ../ node_modules/rxjs/_esm5/internal /在ScannedActionsSubject.push的FilterSubscriber.push ../ node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next(Subscriber.js:54)上的运算符/ filter.js.FilterSubscriber._next(filter.js:38).位于SafeSubscriber._next(store.js:332)的SafeSubscriber.push ../ node_modules/rxjs/_esm5/internal /中的./node_modules/rxjs/_esm5/internal/Subject.js.Subject.next(Subject.js:47) Subscriber.js.SafeSubscriber .__ tryOrUnsub(Subscriber.js:195)位于苏的SafeSubscriber.push ../ node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next(Subscriber.js:133)bscriber.push ../ node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next(Subscriber.js:77)

我的代码如下所示:

import { Injectable } from '@angular/core';
import { Effect, Actions } from '@ngrx/effects';
import { of } from 'rxjs/observable/of';
import { map, catchError, switchMap } from 'rxjs/operators';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/timer';

import * as hybridActions from '../actions/hybrid.action';
import { FleetStatusReportService } from '../../fleet-status-report.service';

@Injectable()
export class HybridEffects {
  constructor( …
Run Code Online (Sandbox Code Playgroud)

rxjs typescript ngrx angular

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

Angular D3 理解 attrTween 函数

我试图了解如何在 D3 中使用 attrTween 函数。我正在尝试从以下示例中实现饼图:http : //bl.ocks.org/mbostock/5100636

然而,当我到达过渡部分时,我遇到了问题。

  private populateGauge(): void {
    const innerRadius = this.radius - 50;
    const outerRadius = this.radius - 10;
    const arc = d3
      .arc()
      .innerRadius(innerRadius)
      .outerRadius(outerRadius)
      .startAngle(0);

    const background = this.svg
      .append('path')
      .datum({ endAngle: this.tau })
      .style('fill', '#ddd')
      .attr('d', arc);
    this.myEndAngle = { endAngle: (this.gaugeData.value / 100) * this.tau };
    const foreground = this.svg
      .append('path')
      .datum(this.myEndAngle)
      .style('fill', 'orange')
      .attr('d', arc);

    foreground
      .transition()
      .duration(1500)
      .attrTween('d', function(newAngle) {
        return function(d) {
          const interpolate = d3.interpolate(d.endAngle, …
Run Code Online (Sandbox Code Playgroud)

javascript d3.js typescript angular

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

传单将坐标转换为街道地址

我正在创建一个使用传单地图的应用程序。我想知道是否有任何外部库可以用来将坐标转换为街道地址?我使用 Angular 6。

javascript maps leaflet typescript angular

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

标签 统计

angular ×3

typescript ×3

javascript ×2

d3.js ×1

leaflet ×1

maps ×1

ngrx ×1

rxjs ×1