Created
April 14, 2015 11:18
-
-
Save vsheyanov/8ef3ca894610d5aa7760 to your computer and use it in GitHub Desktop.
@HtmlImport issue (working example)
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 '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> | |
<script type="application/dart" src="child_component.dart"></script> | |
</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
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Polymer-Customer-Care</title> | |
<link rel="import" href="child_component.html"> | |
<link rel="import" href="parent_component.html"> | |
</head> | |
<body> | |
<parent-component></parent-component> | |
<script type="application/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
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
<link rel="import" href="child_component.html"> | |
<polymer-element name="parent-component"> | |
<template> | |
<child-component selectedValue="{{selectedValue}}"></child-component> | |
</template> | |
<script type="application/dart" src="parent_component.dart"></script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment