Minor improvements

This commit is contained in:
Denys Vuika
2016-04-15 12:11:49 +01:00
parent 6cb98e516f
commit 6832e591b4
2 changed files with 4 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ import {Component} from "angular2/core";
List below is a web component bound to array of items coming from angular.<br>
Add/remove buttons control angular array and web component reacts on changes.
</p>
<simple-list [items]="items"></simple-list>
<simple-list [items]="items" class="list-unstyled"></simple-list>
<button (click)="addItem()">add item</button>
<button (click)="removeItem()">remove item</button>
</div>
@@ -28,7 +28,7 @@ export class Page2View {
items = ['one', 'two', 'three'];
addItem() {
this.items.push('test');
this.items.push(new Date());
}
removeItem() {

View File

@@ -72,8 +72,8 @@
this.list.innerHTML = '';
if (_items && _items.length > 0) {
for (var i = 0; i < _items.length; i++) {
var item = document.createElement('div');
item.textContent = 'item ' + i;
var item = document.createElement('li');
item.textContent = _items[i];
this.list.appendChild(item);
}
}