0.0.2 • Published 4 years ago

@qlee/ng-template v0.0.2

Weekly downloads
767
License
Apache-2.0
Repository
github
Last release
4 years ago

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>