小编jac*_*ipe的帖子

WebStorm 不突出显示 JS 代码

WebStorm 无法正确突出显示 JS 代码,无论是在 HTML 文件中还是在 JS 文件中。当我想使用 获取元素的 ID 时,它显示未解析的变量或类型文档document.getElementByiD

在此输入图像描述

我还捕获了设置

在此输入图像描述

在此输入图像描述

javascript syntax webstorm

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

操作必须具有类型属性错误NgRx

我有simle特效类,必须从Firebase获取一些数据并发送新动作.

@Injectable()
export class TripsEffects {

     constructor(private actions$: Actions, private afAuth: AngularFireAuth ) {}

     @Effect()
     loadTrips$ = this.actions$.ofType(TripsActionsTypes.LOAD_TRIPS)
         .pipe(
             switchMap(() => {
                 return this.afAuth.authState.pipe(
                     map(user => new LoadTripsSuccess(user))
                 );
            })
         );
}
Run Code Online (Sandbox Code Playgroud)

但我得到错误Actions must have a type property.当用户登录时,它们被重定向到Trips页面,而在Trips组件中,我将调度一个动作来加载行程.这是我的行动:

export enum TripsActionsTypes {
    LOAD_TRIPS = '[Trips] Load Trips',
    LoadTripsSuccess = '[Trips] Load Trips Success',
    LoadTripsFailure = '[Trips] Load Trips Failure'
}

export class  LoadTrips implements Action {
    type: TripsActionsTypes.LOAD_TRIPS;
}

export class  LoadTripsSuccess implements Action {
    type: TripsActionsTypes.LoadTripsSuccess;
    constructor(public …
Run Code Online (Sandbox Code Playgroud)

ngrx ngrx-effects angular

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

标签 统计

angular ×1

javascript ×1

ngrx ×1

ngrx-effects ×1

syntax ×1

webstorm ×1