如何在应用程序加载时获得要呈现的状态?当我运行这个应用程序时,状态是空的,直到我用click函数点击按钮。我试着做this.store.select,但是我永远得不到请求的状态。Todo_List是ngrx存储中的一个对象,我想呈现它的列表属性,它是一个数组
App.Component.ts
import { Component,OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from './AppState.model'
我已经在angular (版本5.2.9)应用程序中使用ngrx/store (版本5.2.0)和typescript版本(2.5.3)实现了状态管理。
当我尝试选择商店并订阅时,我遇到了问题。
error TS2345: Argument of type '"appStateData"' is not assignable to parameter of type '"appState"'.
app.module.ts
import { StoreModule } from '@ngrx/store';
impo
我遵循官方文档更新angular应用程序,在我更新所有内容之后,当我运行ng serve时,我得到以下错误 ERROR in app/src/app/users/add/add.component.html:14:48 - error NG2345: Argument of type 'AbstractControl' is not assignable to parameter of type 'FormControl'.
Type 'AbstractControl' is missing the following properties
我今天开始从角4.4.4升级到5.1.1。我已经升级了许多其他的软件包,依赖于角以及。由于上下文太少,我遇到了一个错误,我不知道从哪里开始。有没有其他人看到这个,知道问题出在哪里?
$ ng serve --aot=false
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2017-12-19T15:26:36.137Z
Hash: bf0b773d5dfafdd9133b
Time: 16934ms
chunk
我正在使用来自@ngrx/store的@ngrx/store来从我的商店中选择一个对象数组。
我的应用程序编译,但是我得到了错误。
Argument of type 'MemoizedSelector<ICommonAppState, IMenuItemsObject[]>' is not assignable to parameter of type 'string'.
navigation.selectors.ts
import { createSelector } from '@ngrx/store';
import { RED
我已经找到了答案,但找不到解决问题的办法。
我已经更新了从版本8到版本9的“角”版本。在8版上一切都很好,但是在更新之后,由于错误,应用程序不会编译。
src/app/groups/groups.module.ts:45:14 - error NG6002: Appears in the NgModule.imports of AppModule, but itself has errors
但是这个模块不包含任何错误。它是干净的,就像它在第8版工作时一样。我尝试了不同的东西:
删除node_modules和重新安装软件包
关闭终端并重新打开
关闭编辑器(VSC)并重新打开
使
在构建一个刚从Angular创建的全新项目时收到此错误消息: ERROR in node_modules/@ngrx/store/src/ng2.d.ts(1,10): error TS2305: Module '"../../../@angular/core/core"' has no exported member 'OpaqueToken'. 我做了大量的搜索,发现了一些不是我的问题。下面是一些例子: 1) Module '"node_modules/@angular/core/core"' has no