ts中的角度2绑定分量

时间:2017-07-10 09:08:41

标签: angular bootstrap-modal angular2-template angular2-services

当我点击模型需要将组件插入模型<miniStatement></miniStatement>

时,我正在使用bootstrap模型
miniStatement() {
    const activeModal = this.modalService.open(statementHistory, {size: 'lg'});
    activeModal.componentInstance.modalHeader = 'Mini Statement';
    activeModal.componentInstance.modalContent = `<miniStatement></miniStatement> `;
  }
}

<div class="modal-content">
  <div class="modal-header">
    <h4 class="modal-title">{{modalHeader}}</h4>
    <button class="close" aria-label="Close" (click)="closeModal()">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>
  <div class="modal-body">
{{modalContent}}
  </div>
</div>

0 个答案:

没有答案