Simplify Angular 2 template where possible

This commit is contained in:
SteveSandersonMS
2016-09-19 12:44:25 +01:00
parent 243a9b4ef6
commit 8f550c5706
20 changed files with 77 additions and 252 deletions

View File

@@ -0,0 +1,7 @@
<h2>Counter</h2>
<p>This is a simple example of an Angular 2 component.</p>
<p>Current count: <strong>{{ currentCount }}</strong></p>
<button (click)="incrementCounter()">Increment</button>

View File

@@ -0,0 +1,13 @@
import { Component } from '@angular/core';
@Component({
selector: 'counter',
template: require('./counter.component.html')
})
export class CounterComponent {
public currentCount = 0;
public incrementCounter() {
this.currentCount++;
}
}