kittencup / angular2-ama-cn

angular2 随便问
692 stars 101 forks source link

怎么类似angular1 $compile一段html #194

Open ruanzy opened 8 years ago

winpzs commented 7 years ago
<template #rowToolbar let-cell>
   这里是内容{{cell.a}}
   <div>let-cell会传入cell的值, 就ngOutletContext的$implicit</div>
</template>
原码: https://github.com/guless/AmazeUI-ng2/blob/master/app/demo/table.component.html

<template [ngTemplateOutlet]="rowToolbar" [ngOutletContext]="{ $implicit: {a:1, b:s}}"></template>
原码: https://github.com/guless/AmazeUI-ng2/blob/master/app/shared/minitable.component.html