Last active
August 3, 2016 23:57
-
-
Save yjbanov/6819db1440a96c82c1b2b43fdc5f43c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// contact_editor.dart | |
// - light-weight annotations | |
// - DI-related annotations OK | |
@Component('contact-editor') | |
class ContactEditor { | |
String get name => 'John Doe'; | |
bool isEditing = false; | |
} | |
// contact_editor.html | |
// - self-sufficient for generating contact_editor.template.dart | |
// - imports everything used in the template | |
// - like in Dart everything lexically scoped | |
import package:angular2/directives.dart | |
import contact_editor.dart | |
<ContactEditor> | |
<div *ngIf="!isEditing"> | |
{{name}} | |
</div> | |
<input *ngIf="isEditing" type="text" [value]="name""> | |
</ContactEditor> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment