From: hackbard Date: Mon, 17 Oct 2016 20:29:05 +0000 (+0200) Subject: introduced table components X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=678f7561b74d47e36309ac4ee1007a326e4b7650;p=outofuni%2Ftavern2.git introduced table components --- diff --git a/lib/table.dart b/lib/table.dart new file mode 100644 index 0000000..dec2a14 --- /dev/null +++ b/lib/table.dart @@ -0,0 +1,18 @@ +class Coord { + int x; + int y; + + Coord(this.x,this.y); +} + +class Table { + String id; + String name; + int num; + int room; + Coord coord; + String type; + + Table(this.id,this.name,this.num,this.room,this.coord,this.type); +} + diff --git a/lib/table_service.dart b/lib/table_service.dart new file mode 100644 index 0000000..f73f327 --- /dev/null +++ b/lib/table_service.dart @@ -0,0 +1,20 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:angular2/core.dart'; +import 'package:http/browser_client.dart'; + +import 'db.dart'; + +import 'table.dart'; + +@Injectable() +class TableService { + final BrowserClient _http; + + static const _byroom='_design/tables/_view/byroom'; + static const _bynum='_design/tables/_view/bynum'; + + TableService(this._http); +} + diff --git a/lib/tables_component.css b/lib/tables_component.css new file mode 100644 index 0000000..e69de29 diff --git a/lib/tables_component.dart b/lib/tables_component.dart new file mode 100644 index 0000000..39bc280 --- /dev/null +++ b/lib/tables_component.dart @@ -0,0 +1,28 @@ +import 'dart:async'; + +import 'package:angular2/core.dart'; +import 'package:angular2/router.dart'; + +import 'table.dart'; +import 'table_service.dart'; + +import 'package:angular2_rbi/directives.dart'; + +@Component( + selector: 'my-tables', + templateUrl: 'tables_component.html', + styleUrls: const ['tables_component.css'], + directives: const [MaterialTextfield,MaterialButton], + providers: const [TableService] +) + +class TablesComponent implements OnInit { + List tables; + Table selected_table; + final TableService _tableSrv; + final Router _router; + + TablesComponent(this._tableSrv,this._router); + +} + diff --git a/lib/tables_component.html b/lib/tables_component.html new file mode 100644 index 0000000..e69de29