使用Input()装饰器

时间:2017-07-26 13:24:38

标签: angular ngrx

当我尝试更新app-check-pattern组件中的pattern值时,我不知道为什么会显示此错误

ERROR TypeError: Cannot assign to read only property 'example' of object '[object Object]'
    at Object.handleEvent

这就是我调用组件的方式

<app-check-pattern [pattern]="(pattern$ | async)"
                         (eventPattern)="receiveAction($event)"></app-check-pattern>

在调用者组件中我有这段代码

    export class PatternUpdateComponent implements OnInit {
      pattern$ : Observable<PatternModel>
      .......          
      constructor(public state : Store<AppSateWithPattern>) {
        this.state.replaceReducer(appReducerPatternDetailsUpdate)
        this.pattern$ = this.state.select((state:AppSateWithPatternDetails) => state.patternSelected);
        ..................
      }
.....

原因在于模式$ observable,因为我使用简单变量进行更改并且它可以工作 任何想法如何解决这个问题?

更新

 export interface PatternModel {
     .....
      pattern: string;
      transformation: string;
      example: string;
............

    }

0 个答案:

没有答案
相关问题