Expression ___ has changed after it was checked

后端 未结 17 1875
太阳男子
太阳男子 2020-11-22 05:53

Why is the component in this simple plunk

@Component({
  selector: \'my-app\',
  template: `
I\'m {{message}}
`, }) export class App {
17条回答
  •  终归单人心
    2020-11-22 06:22

    I fixed this by adding ChangeDetectionStrategy from angular core.

    import {  Component, ChangeDetectionStrategy } from '@angular/core';
    @Component({
      changeDetection: ChangeDetectionStrategy.OnPush,
      selector: 'page1',
      templateUrl: 'page1.html',
    })
    

提交回复
热议问题