typescript 阿比 - 3.ts

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript 阿比 - 3.ts相关的知识,希望对你有一定的参考价值。

@Component({
  selector: 'app-filters',
  template: 'Filters form..'
})
export class FiltersComponent implements OnInit {
  filters: FormGroup;
  persistForm: PersistNgFormPlugin;

  constructor(private productsQuery: ProductsQuery) { }

  ngOnInit() {
    this.filters = new FormGroup({
      condition: new FormGroup({
        new: new FormControl(false),
        used: new FormControl(false),
        notSpecified: new FormControl(false)
      }),
      location: new FormControl()
    });

    this.persistForm = new PersistNgFormPlugin(this.productsQuery, 'ui.filters')
      .setForm(this.filters);
  }

  reset() {
    // reset the current state to the initial value
    this.persistForm.reset();
  }

  ngOnDestroy() {
    this.persistForm.destroy();
  }

}

以上是关于typescript 阿比 - 3.ts的主要内容,如果未能解决你的问题,请参考以下文章

typescript 阿比 - 4.ts

typescript 阿比 - 1.ts

typescript 3.ts

typescript 搜索3.ts

typescript ML-3.ts

typescript SD-3.ts