Skip to content

Instantly share code, notes, and snippets.

@karthikchintala1
Created July 2, 2017 08:49
Show Gist options
  • Save karthikchintala1/5dd205a0a85569bd2a207118b354a914 to your computer and use it in GitHub Desktop.
Save karthikchintala1/5dd205a0a85569bd2a207118b354a914 to your computer and use it in GitHub Desktop.
template for structural directive in angular
import {Component, NgModule, VERSION} from '@angular/core'
@Component({
selector: 'my-app',
template: `
<div>
<h2>Hello {{name}}</h2>
</div>
<ul *ngFor="let item of [1,2,3,4,5,6,7,8,9,10]">
<li *onlyEvens="item">{{item}}</li>
</ul>
`,
})
export class App {
name:string;
constructor() {
this.name = `Angular! v${VERSION.full}`
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment