- a little box drawn around some functionality in a reusable way
- Polymer.js, React.js, Ember.Component, Mozilla Brick, etc
- DX issues: a Backbone component...?
Last active
August 29, 2015 14:04
-
-
Save alexmcpherson/4ebc65db31cd2a2ce0e2 to your computer and use it in GitHub Desktop.
polymer-presentation
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
//spoiler: I just copy this from view to view. Bad ergonomics. | |
attachIncrementors: function() { | |
var incrementor = new IncrementorView({ | |
attrName : 'difference', | |
model: this.model.dishwashing_model, | |
options: Helpers.range(0, 100), | |
template: JST['components/load_incrementor'] | |
}); | |
incrementor.render(); | |
this.$('#dishLoadsIncrementor').html(incrementor.el); | |
}, |
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
<body> | |
<!-- WHAT THIS IS CRAZY USEFUL --> | |
<carousel autoplay controls='false'> | |
<img src='1.png' /> | |
<img src='2.gif' /> | |
<img src='3.jpg' /> | |
</carousel> | |
</body> |
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
<body> | |
<!-- How does that... I don't even... --> | |
<twitter-follow user='@alexmcpherson'>Follow me!</twitter-follow> | |
</body> |
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
<html> | |
<head> | |
<!-- 1. Load platform.js for polyfill support. --> | |
<script src="bower_components/platform/platform.js"></script> | |
<!-- 2. Use an HTML Import to bring in the element. --> | |
<link rel="import" | |
href="bower_components/core-ajax.html"> | |
</head> | |
<body> | |
<!-- 3. Declare the element. Configure using its attributes. --> | |
<core-ajax url="http://example.com/json" | |
handleAs="json"></core-ajax> | |
<script> | |
window.addEventListener('polymer-ready', function(e) { | |
var ajax = document.querySelector('core-ajax'); | |
ajax.addEventListener('core-response', function(e) { | |
console.log(this.response); | |
}); | |
ajax.go(); // Call its API methods. | |
}); | |
</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
//lifecycle filters | |
Polymer('sweet-tag', { | |
created: function() { ... }, | |
ready: function() { ... }, | |
attached: function () { ... }, | |
domReady: function() { ... }, | |
detached: function() { ... }, | |
nameChanged: function() { //magic! }, | |
}); | |
//expressions in templates | |
<div class="{{ {active: user.selected, big: user.type == 'super'} | tokenList }}"> |
- Testing? ezpz
- HTML Load times and file sizes? Vulcanize
- Sharing or using sweet internet stuff?
Bower
- Mobile? A primary goal Topeka
- two way data binding
- element inheritance
- plays fine with
CSS
pre-processers - nuzzles in nicely to the grunt/gulp/bower/yeoman toolchain
- not all you can eat: take what you need
- this thing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment