diff --git a/public/docs/_examples/template-syntax/dart/lib/app_component.dart b/public/docs/_examples/template-syntax/dart/lib/app_component.dart index 6a3def5aa4..4be7533fcc 100644 --- a/public/docs/_examples/template-syntax/dart/lib/app_component.dart +++ b/public/docs/_examples/template-syntax/dart/lib/app_component.dart @@ -7,7 +7,8 @@ import 'package:angular2/common.dart'; import 'hero.dart'; import 'hero_detail_component.dart'; -import 'my_click_directive.dart'; +import 'click_directive.dart'; +import 'sizer_component.dart'; enum Color { red, green, blue } @@ -18,7 +19,8 @@ enum Color { red, green, blue } HeroDetailComponent, BigHeroDetailComponent, MyClickDirective, - MyClickDirective2 + MyClickDirective2, + MySizerComponent ]) class AppComponent implements OnInit, AfterViewInit { @override @@ -165,6 +167,7 @@ class AppComponent implements OnInit, AfterViewInit { bool isItalic = false; bool isBold = false; String fontSize = 'large'; + String fontSizePx = '14'; Map setStyle() { return { diff --git a/public/docs/_examples/template-syntax/dart/lib/app_component.html b/public/docs/_examples/template-syntax/dart/lib/app_component.html index 9fd72765ed..3255a02ff6 100644 --- a/public/docs/_examples/template-syntax/dart/lib/app_component.html +++ b/public/docs/_examples/template-syntax/dart/lib/app_component.html @@ -14,7 +14,7 @@

Template Syntax


Event Binding
- +Two-way Binding

Directives
@@ -242,9 +242,6 @@

- - -

@@ -262,7 +259,7 @@

Bad curly
+ [class]="badCurly">Bad curly @@ -309,9 +306,9 @@

- +
click with myClick
- + {{clickMessage}}
@@ -349,6 +346,24 @@



+top + +

Two-way Binding

+
+ + +
Resizable Text
+ + +
+
+
+

De-sugared two-way binding

+ + + +
+

top @@ -746,7 +761,7 @@

Example Form

- {{product['price'] | currency:'USD':false}} + {{product['price'] | currency:'USD':true}}
top diff --git a/public/docs/_examples/template-syntax/dart/lib/my_click_directive.dart b/public/docs/_examples/template-syntax/dart/lib/click_directive.dart similarity index 81% rename from public/docs/_examples/template-syntax/dart/lib/my_click_directive.dart rename to public/docs/_examples/template-syntax/dart/lib/click_directive.dart index 0980478f29..101b9eb5c6 100644 --- a/public/docs/_examples/template-syntax/dart/lib/my_click_directive.dart +++ b/public/docs/_examples/template-syntax/dart/lib/click_directive.dart @@ -5,11 +5,11 @@ import 'package:angular2/core.dart'; @Directive(selector: '[myClick]') class MyClickDirective { - // #docregion my-click-output-1 + // #docregion output-myClick // @Output(alias) [type info] propertyName = ... @Output('myClick') final EventEmitter clicks = new EventEmitter(); - // #enddocregion my-click-output-1 + // #enddocregion output-myClick bool _toggle = false; MyClickDirective(ElementRef el) { @@ -21,14 +21,14 @@ class MyClickDirective { } } -// #docregion my-click-output-2 +// #docregion output-myClick2 @Directive( -// #enddocregion my-click-output-2 +// #enddocregion output-myClick2 selector: '[myClick2]', -// #docregion my-click-output-2 +// #docregion output-myClick2 // ... outputs: const ['clicks:myClick']) // propertyName:alias -// #enddocregion my-click-output-2 +// #enddocregion output-myClick2 class MyClickDirective2 { final EventEmitter clicks = new EventEmitter(); bool _toggle = false; diff --git a/public/docs/_examples/template-syntax/dart/lib/sizer_component.dart b/public/docs/_examples/template-syntax/dart/lib/sizer_component.dart new file mode 100644 index 0000000000..84dbc1d9ff --- /dev/null +++ b/public/docs/_examples/template-syntax/dart/lib/sizer_component.dart @@ -0,0 +1,30 @@ +// #docregion +import 'dart:math'; +import 'package:angular2/core.dart'; + +@Component( + selector: 'my-sizer', + template: ''' +
+ + + +
''') +class MySizerComponent { + static final defaultPxSize = 14; + + @Input() + String size; + + @Output() + var sizeChange = new EventEmitter(); + + void dec() => resize(-1); + void inc() => resize(1); + + void resize(num delta) { + final numSize = num.parse(size, (_) => defaultPxSize); + size = min(40, max(8, numSize + delta)).toString(); + sizeChange.emit(size); + } +} diff --git a/public/docs/dart/latest/guide/template-syntax.jade b/public/docs/dart/latest/guide/template-syntax.jade index bee8fc97a7..fe62bd9084 100644 --- a/public/docs/dart/latest/guide/template-syntax.jade +++ b/public/docs/dart/latest/guide/template-syntax.jade @@ -48,16 +48,6 @@ block dart-type-exception-example In checked mode, the code above will result in a type exception: `String` isn't a subtype of `Hero`. -block dart-class-binding-bug - .callout.is-helpful - header Angular Issue #6901 - :marked - Issue [#6901][6901] prevents us from using `[class]`. As is illustrated - above, in the meantime we can achieve the same effect by binding to - `className`. - - [6901]: http://github.com/angular/angular/issues/6901 - block style-property-name-dart-diff .callout.is-helpful header Dart difference: Style property names diff --git a/public/docs/ts/_cache/guide/template-syntax.jade b/public/docs/ts/_cache/guide/template-syntax.jade index 165db573c3..ef9ab05371 100644 --- a/public/docs/ts/_cache/guide/template-syntax.jade +++ b/public/docs/ts/_cache/guide/template-syntax.jade @@ -21,6 +21,7 @@ block includes * [Property binding](#property-binding) * [Attribute, class, and style bindings](#other-bindings) * [Event binding](#event-binding) + * [Two-way data binding](#two-way) * [Two-way data binding with `NgModel`](#ngModel) * [Built-in directives](#directives) * [NgClass](#ngClass) @@ -44,7 +45,7 @@ block includes HTML is the language of the Angular template. Our [QuickStart](../quickstart.html) application has a template that is pure HTML: code-example(language="html" escape="html"). -

My First Angular 2 App

+

My First Angular App

:marked Almost all HTML syntax is valid template syntax. The `