@qlee/ng-template
v0.0.2
Published
NG Template
Downloads
3
Readme
NgTemplate
Import Module
import { NgTemplateModule } from '@qlee/ng-template';
@NgModule({
declarations: [],
imports: [ NgTemplateModule ],
providers: [],
bootstrap: []
})
export class AppModule { }
Define template
<ng-template ngTemplate="customTemplate" let-model="model">
<h3>{{ title }}</h3> // `title` is current component variable
<h2>{{model.name}}</h2>
<h2>{{model.age}}</h2>
</ng-template>
Use template
// data is the model which is passed to template
<template ngTemplatePlaceholder="customTemplate" [model]="data"></template>