diff --git a/demos/item-sliding/index.ts b/demos/item-sliding/index.ts index 2ab466b7872..65c41e1846a 100644 --- a/demos/item-sliding/index.ts +++ b/demos/item-sliding/index.ts @@ -1,17 +1,52 @@ -import { Component } from '@angular/core'; +import { Component, ViewEncapsulation } from '@angular/core'; import { ionicBootstrap, ItemSliding, NavController, Toast } from 'ionic-angular'; @Component({ - templateUrl: 'main.html' + templateUrl: 'main.html', + encapsulation: ViewEncapsulation.None }) class ApiDemoPage { chats: any[]; logins: any[]; + editButton: string = 'Edit'; + editing: boolean = false; constructor(private nav: NavController) { this.chats = [ + { + img: './avatar-cher.png', + name: 'Cher', + message: 'Ugh. As if.', + time: '9:38 pm' + }, { + img: './avatar-dionne.png', + name: 'Dionne', + message: 'Mr. Hall was way harsh.', + time: '8:59 pm' + }, { + img: './avatar-murray.png', + name: 'Murray', + message: 'Excuse me, "Ms. Dione."', + time: 'Wed' + }, + { + img: './avatar-cher.png', + name: 'Cher', + message: 'Ugh. As if.', + time: '9:38 pm' + }, { + img: './avatar-dionne.png', + name: 'Dionne', + message: 'Mr. Hall was way harsh.', + time: '8:59 pm' + }, { + img: './avatar-murray.png', + name: 'Murray', + message: 'Excuse me, "Ms. Dione."', + time: 'Wed' + }, { img: './avatar-cher.png', name: 'Cher', @@ -49,6 +84,15 @@ class ApiDemoPage { }]; } + toggleEdit() { + this.editing = !this.editing; + if (this.editing) { + this.editButton = 'Done'; + } else { + this.editButton = 'Edit'; + } + } + more(item: ItemSliding) { console.log('More'); item.close(); diff --git a/demos/item-sliding/main.html b/demos/item-sliding/main.html index 5dcd34ef35d..f0aa037119b 100644 --- a/demos/item-sliding/main.html +++ b/demos/item-sliding/main.html @@ -2,19 +2,24 @@ Item Sliding + + + - + - + Chats - + + + @@ -41,13 +46,14 @@

{{chat.name}}

- +
+