Skip to content

Instantly share code, notes, and snippets.

@sethladd
Last active December 26, 2015 13:49
Show Gist options
  • Select an option

  • Save sethladd/7161294 to your computer and use it in GitHub Desktop.

Select an option

Save sethladd/7161294 to your computer and use it in GitHub Desktop.
I am a null (ID: 177863854) and I am ready
I am a null (ID: 924578920) and I am ready
I am a null (ID: 394322034) and I am ready
I am a null (ID: 854832235) and I am ready
I am a null (ID: 587923908) and I am ready
I am a null (ID: 763736301) and I am ready
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sample app</title>
<link rel="stylesheet" href="testme2.css">
<link rel="import" href="test_me.html">
<script type="application/dart" src="packages/polymer/init.dart"></script>
<script src="packages/browser/dart.js"></script>
</head>
<body>
<test-me></test-me>
</body>
</html>
import 'package:polymer/polymer.dart';
@CustomTag('test-me')
class TestMe extends PolymerElement {
final List fruits = toObservable(['apples', 'bananas', 'pears']);
TestMe.created() : super.created();
}
<link rel="import" href="yummy_fruit.html">
<polymer-element name='test-me'>
<template>
<template if="{{fruits.length > 0}}">
<template repeat="{{fruit in fruits}}">
<yummy-fruit fruit="{{fruit}}"></yummy-fruit>
</template>
</template>
</template>
<script type="application/dart" src="test_me.dart"></script>
</polymer-element>
import 'package:polymer/polymer.dart';
@CustomTag('yummy-fruit')
class YummyFruit extends PolymerElement {
@published String fruit;
YummyFruit.created() : super.created();
void ready() {
super.ready();
print('I am a $fruit and I am ready');
}
}
<polymer-element name="yummy-fruit">
<template>
<p>You tasted a {{fruit}}</p>
</template>
<script type="application/dart" src="yummy_fruit.dart"></script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment