mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Minor improvements
This commit is contained in:
@@ -16,7 +16,7 @@ import {Component} from "angular2/core";
|
|||||||
List below is a web component bound to array of items coming from angular.<br>
|
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.
|
Add/remove buttons control angular array and web component reacts on changes.
|
||||||
</p>
|
</p>
|
||||||
<simple-list [items]="items"></simple-list>
|
<simple-list [items]="items" class="list-unstyled"></simple-list>
|
||||||
<button (click)="addItem()">add item</button>
|
<button (click)="addItem()">add item</button>
|
||||||
<button (click)="removeItem()">remove item</button>
|
<button (click)="removeItem()">remove item</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,7 +28,7 @@ export class Page2View {
|
|||||||
items = ['one', 'two', 'three'];
|
items = ['one', 'two', 'three'];
|
||||||
|
|
||||||
addItem() {
|
addItem() {
|
||||||
this.items.push('test');
|
this.items.push(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
removeItem() {
|
removeItem() {
|
||||||
|
@@ -72,8 +72,8 @@
|
|||||||
this.list.innerHTML = '';
|
this.list.innerHTML = '';
|
||||||
if (_items && _items.length > 0) {
|
if (_items && _items.length > 0) {
|
||||||
for (var i = 0; i < _items.length; i++) {
|
for (var i = 0; i < _items.length; i++) {
|
||||||
var item = document.createElement('div');
|
var item = document.createElement('li');
|
||||||
item.textContent = 'item ' + i;
|
item.textContent = _items[i];
|
||||||
this.list.appendChild(item);
|
this.list.appendChild(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user