Move App HTML into Separate Template

This commit is contained in:
Marty Oehme 2018-07-07 17:47:21 +02:00
parent 3780e61453
commit 843dad6cbb
3 changed files with 14 additions and 14 deletions

View file

@ -5,19 +5,6 @@ import 'package:rules_of_living/src/App.dart';
@Component(
selector: 'my-app',
template: '''
<h1>Cellular Automata - The Rules of Life</h1>
<div id="output">
<canvas #caCanvas width="500" height="500"></canvas>
</div>
<div id="controls">
<button id="run">Run</button>
<button id="step">Step</button>
<button id="reset">Reset</button>
<button id="random">Random</button>
<input id="speed" title="Speed" value="1">
</div>
''',
)
class AppComponent implements OnInit {
var name = "World";

14
lib/app_component.html Normal file
View file

@ -0,0 +1,14 @@
<h1>Cellular Automata - The Rules of Life</h1>
<div id="rules-input">
Ruleset: <input type="text" title="ruleset" content="S23/B3">
</div>
<div id="output">
<canvas #caCanvas width="500" height="500"></canvas>
</div>
<div id="controls">
<button id="run" >Run</button>
<button id="step">Step</button>
<button id="reset">Reset</button>
<button id="random">Random</button>
Speed: <input type="text" title="speed" value="1">
</div>

View file

@ -1,6 +1,5 @@
import 'dart:html' as html;
import 'package:rules_of_living/src/Cell.dart';
import 'package:rules_of_living/src/Grid.dart';
class App {