Created
April 14, 2015 11:14
-
-
Save vsheyanov/349d8210f566b80b5e25 to your computer and use it in GitHub Desktop.
@HtmlImport issue 1 (doesn't work)
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
@HtmlImport('child_component.html') | |
library com.polymertest.childcomponent; | |
import 'package:polymer/polymer.dart'; | |
import 'data_vo.dart'; | |
@CustomTag('child-component') | |
class ChildComponent extends PolymerElement{ | |
@published DataVO selectedValue; | |
ChildComponent.created() : super.created(){ | |
} | |
@ObserveProperty('selectedValue') | |
void onValueChange(){ | |
print(selectedValue.runtimeType.toString()); | |
} | |
} |
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
<polymer-element name="child-component"> | |
<template> | |
Value: {{selectedValue.label}} | |
</template> | |
</polymer-element> |
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
library polymertest.datavo; | |
import 'package:observe/observe.dart'; | |
class DataVO extends Object with Observable{ | |
@observable String label = "VVV"; | |
} |
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
import 'parent_component.dart'; | |
import 'child_component.dart'; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Polymer-Customer-Care</title> | |
</head> | |
<body> | |
<parent-component></parent-component> | |
<script type="application/dart"> | |
import 'imports.dart'; | |
import 'package:polymer/polymer.dart'; | |
main () => initPolymer(); | |
</script> | |
</body> | |
</html> |
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
@HtmlImport('parent_component.html') | |
library com.polymertest.parentcomponent; | |
import 'package:polymer/polymer.dart'; | |
import 'data_vo.dart'; | |
@CustomTag('parent-component') | |
class ParentComponent extends PolymerElement{ | |
@observable DataVO selectedValue; | |
ParentComponent.created() : super.created(){ | |
selectedValue = new DataVO(); | |
} | |
} |
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
<polymer-element name="parent-component"> | |
<template> | |
<child-component selectedValue="{{selectedValue}}"></child-component> | |
</template> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment