我正在尝试在我的功能中选择状态时使用属性'take',但我收到了错误Property 'take' does not exist on type 'Store<State>.请问,任何人都知道发生了什么事吗?我想这样做的原因是因为我必须确定用户何时点击了"添加空间"按钮,这会将我的模板更改为表单.由于此模式也会更改父模板,因此我使用@ ngrx/store管理它.
我的代码:
import { Component, Input, OnInit, OnDestroy } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Store } from '@ngrx/store';
import { Subscription } from 'rxjs/Subscription';
import { Space } from '../../../shared/space.model';
// import { SpacesService } from '../../spaces.service';
import * as SpacesActions from '../../store/spaces.actions';
import * as fromSpaces from '../../store/spaces.reducers';
@Component({
selector: 'app-space-item',
templateUrl: './space-item.component.html',
styleUrls: ['./space-item.component.scss']
})
export class SpaceItemComponent implements OnInit, OnDestroy {
@Input() …Run Code Online (Sandbox Code Playgroud)