正确使用* ngFor与异步管道

时间:2017-02-05 04:43:38

标签: angular rxjs angular2-template angular2-directives rxjs5

如果我使用* ngFor构建访问链,我无法访问异步管道提供的对象的属性。

在下面的示例中,假设测试行中的?.filter和下面的propName两行代表同一对象上的相同键。测试行将评估为true,但checked属性不会。为什么?如何使用* ngFor?

标记这些内容时如何访问该属性

(此外,我应该如何访问compModel上的{{(compModel | async)?.(filter.propName)}} <fieldset class="filter-category-title"> <legend>{{filter.name}}</legend> <label *ngFor="let instance of filter.options"> test: {{(compModel | async)?.Parking}} <input type="checkbox" checked={{(compModel | async)?.(filter.propName)?.instance}} (click)="amenityEmit({category: filter.propName, filter: instance, resetCategory: false})"> {{instance}} </label> </fieldset> 无论如何都无法工作。)

edtFirstname.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
          if (!hasFocus) {
          //do validation here
          }
        }
    });

*与此问题相关的Problems using async pipe with ngFor in Angular2

0 个答案:

没有答案
相关问题