About
The NgAnimate module is a port with modifications of the original AngularJS animation module. The default implementation does nothing. @@ -22,6 +23,7 @@
About
added it allows you define and run css animations on your elements with pure CSS.Check out the demos above.
+ng-repeat Demo
diff --git a/example/web/bouncing_balls.dart b/example/web/bouncing_balls.dart index d2d3ca3a4..fc1057462 100644 --- a/example/web/bouncing_balls.dart +++ b/example/web/bouncing_balls.dart @@ -1,9 +1,10 @@ -import 'package:angular/angular.dart'; -import 'package:angular/application_factory.dart'; import 'dart:html'; import 'dart:math'; import 'dart:core'; +import 'package:angular/angular.dart'; +import 'package:angular/application_factory.dart'; + var random = new Random(); var width = 400; var height = 400; @@ -23,23 +24,26 @@ class BallModel { } return color; } - } -@Controller( - selector: '[bounce-controller]', - publishAs: 'bounce') + +@Component( + selector: 'bounce-controller', + publishAs: 'ctrl', + templateUrl: 'bouncing_controller.html', + cssUrl: 'bouncing_controller.css' +) class BounceController { + RootScope rootScope; var lastTime = window.performance.now(); var run = false; var fps = 0; var digestTime = 0; var currentDigestTime = 0; var balls = []; - final Scope scope; var ballClassName = 'ball'; - BounceController(this.scope) { + BounceController(this.rootScope) { changeCount(100); if (run) tick(); } @@ -72,7 +76,7 @@ class BounceController { void timeDigest() { var start = window.performance.now(); digestTime = currentDigestTime; - scope.rootScope.domRead(() { + rootScope.domRead(() { currentDigestTime = window.performance.now() - start; }); } @@ -82,7 +86,7 @@ class BounceController { var delay = now - lastTime; fps = (1000/delay).round(); - for(var i=0, ii=balls.length; i- Digest: {{bounce.digestTime}} ms
- +1 - +10 - +100 -
- -1 - -10 - -100 -
- ▶❙❙
- Toggle CSS
- noop
-
+Digest: {{ ctrl.digestTime }} ms
++1 ++10 ++100 +
+-1 +-10 +-100 +
+▶❙❙
+Toggle CSS
+noop
\ No newline at end of file diff --git a/example/web/form.dart b/example/web/form.dart index 99a6c18c0..4d96eb035 100644 --- a/example/web/form.dart +++ b/example/web/form.dart @@ -1,9 +1,11 @@ import 'package:angular/angular.dart'; import 'package:angular/application_factory.dart'; -@Controller( - selector: '[form-controller]', - publishAs: 'form_ctrl') +@Component( + selector: '[form-controller]', + templateUrl: 'form_controller.html', + publishAs: 'form_ctrl', + useShadowDom: false) class FormCtrl { static const String _COLOR_HEX = "hex"; static const String _COLOR_HSL = "hsl"; @@ -104,11 +106,13 @@ class FormCtrl { } } -@Controller( - selector: '[preview-controller]', - publishAs: 'preview') +@Decorator( + selector: '[preview-controller]' +) class PreviewCtrl { - static const _DEFAULT_COLOR = '#555'; + PreviewCtrl(Scope scope) { + scope.context['preview'] = this; + } List _collection = []; diff --git a/example/web/form.html b/example/web/form.html index e3246f256..74f0cbf5d 100644 --- a/example/web/form.html +++ b/example/web/form.html @@ -9,175 +9,7 @@ - - + diff --git a/example/web/form_controller.dart b/example/web/form_controller.dart new file mode 100644 index 000000000..6d747aa9f --- /dev/null +++ b/example/web/form_controller.dart @@ -0,0 +1,131 @@ +import 'package:angular/angular.dart'; + +@Component( + selector: '[form-controller]', + templateUrl: 'form_controller.html', + publishAs: 'form_ctrl', + useShadowDom: false) +class FormCtrl { + static const String _COLOR_HEX = "hex"; + static const String _COLOR_HSL = "hsl"; + static const String _COLOR_RGB = "rgb"; + static const String _COLOR_NAME = "name"; + + static const _COLOR_TYPES = const [_COLOR_RGB, _COLOR_HSL, _COLOR_HEX, _COLOR_NAME]; + + static const _RESOLUTIONS = const ['1024x600', + '1280x800', + '1366x768', + '1440x900', + '1600x900', + '1680x1050', + '1920x1080', + '1920x1200', + '2560x1440', + '2560x1600']; + + final Scope scope; + final NgForm form; + final List colors = []; + final List formattedColors = []; + + FormCtrl(this.scope, this.form) { + newColor(_COLOR_HEX, '#222'); + newColor(_COLOR_HEX, '#444'); + newColor(_COLOR_HEX, '#000'); + } + + List