WebStorm 无法正确突出显示 JS 代码,无论是在 HTML 文件中还是在 JS 文件中。当我想使用 获取元素的 ID 时,它显示未解析的变量或类型文档document.getElementByiD。
我还捕获了设置
我有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)