Binding events when using a ngForTemplate in Angular 2

前端 未结 2 1372
感情败类
感情败类 2020-12-01 09:33

Let\'s say I\'ve got this simple list rendering component:

import {Input, Component } from \'angular2/core\'

@Component({
  selector: \'my-list\',
  templat         


        
2条回答
  •  时光取名叫无心
    2020-12-01 10:31

    Been looking for an answer to this for a week now and I finally came up with a pretty decent solution. Instead of using ngForTemplate I would suggest using ngTemplateOutlet.

    It is already described pretty well here: angular2 feeding data back to `