mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-25 19:17:30 +00:00
Add Angular2Spa template
This commit is contained in:
@@ -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>
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as ng from 'angular2/core';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'counter'
|
||||
})
|
||||
@ng.View({
|
||||
template: require('./counter.html')
|
||||
})
|
||||
export class Counter {
|
||||
public currentCount = 0;
|
||||
|
||||
public incrementCounter() {
|
||||
this.currentCount++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user