Implement Canvas as Angular Component
This commit is contained in:
parent
827ab83b88
commit
3780e61453
2 changed files with 25 additions and 20 deletions
|
|
@ -1,23 +1,7 @@
|
|||
import 'dart:html' as html;
|
||||
|
||||
import 'package:rules_of_living/App.dart';
|
||||
|
||||
import 'package:angular/angular.dart';
|
||||
import 'package:rules_of_living/app_component.template.dart' as ng;
|
||||
|
||||
html.CanvasElement el;
|
||||
App engine;
|
||||
|
||||
void main() {
|
||||
runApp(ng.AppComponentNgFactory);
|
||||
|
||||
el = new html.CanvasElement(width: 500, height: 500);
|
||||
html.querySelector('#output').append(el);
|
||||
engine = new App(el);
|
||||
html.window.animationFrame.then(animFrame);
|
||||
}
|
||||
|
||||
void animFrame(num now) {
|
||||
engine.process(now);
|
||||
html.window.animationFrame.then(animFrame);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue