From 917d1c3fabc5ea5e2337771b357e52523709785b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 22 Aug 2018 13:00:41 +0200 Subject: [PATCH] Split App Header into Component --- lib/app_component.dart | 4 +++- lib/app_component.html | 15 ++------------- lib/components/header_component.dart | 13 +++++++++++++ lib/components/header_component.html | 12 ++++++++++++ 4 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 lib/components/header_component.dart create mode 100644 lib/components/header_component.html diff --git a/lib/app_component.dart b/lib/app_component.dart index 10c8575..ee605b1 100644 --- a/lib/app_component.dart +++ b/lib/app_component.dart @@ -1,5 +1,6 @@ import 'package:angular/angular.dart'; import 'package:angular_components/angular_components.dart'; +import 'package:rules_of_living/components/header_component.dart'; import 'dart:html' as html; import 'package:rules_of_living/src/Engine.dart'; @@ -7,7 +8,8 @@ import 'package:rules_of_living/src/Engine.dart'; @Component( selector: 'my-app', templateUrl: "app_component.html", - directives: [coreDirectives, materialDirectives], + directives: [coreDirectives, MaterialButtonComponent, MaterialIconComponent, MaterialSliderComponent, HeaderComponent], + providers: [materialProviders], styleUrls: const ['package:angular_components/app_layout/layout.scss.css'], ) class AppComponent implements OnInit { diff --git a/lib/app_component.html b/lib/app_component.html index 0532aea..9406daa 100644 --- a/lib/app_component.html +++ b/lib/app_component.html @@ -1,15 +1,4 @@ -
-
- - - - Cellular Automata -
- -
-
+
Ruleset: @@ -28,6 +17,6 @@ - Speed: + Speed:
diff --git a/lib/components/header_component.dart b/lib/components/header_component.dart new file mode 100644 index 0000000..94e9a9b --- /dev/null +++ b/lib/components/header_component.dart @@ -0,0 +1,13 @@ +import 'package:angular/angular.dart'; +import 'package:angular_components/angular_components.dart'; + +@Component( + selector: 'app_header', + templateUrl: "header_component.html", + directives: [coreDirectives, MaterialButtonComponent, MaterialIconComponent, MaterialSliderComponent], + providers: [], + styleUrls: const ['package:angular_components/app_layout/layout.scss.css'], +) +class HeaderComponent { + +} diff --git a/lib/components/header_component.html b/lib/components/header_component.html new file mode 100644 index 0000000..2f87a66 --- /dev/null +++ b/lib/components/header_component.html @@ -0,0 +1,12 @@ +
+
+ + + + Cellular Automata +
+ +
+
\ No newline at end of file