Skip to content

Instantly share code, notes, and snippets.

@bluepnume
Forked from anonymous/gist:4384810
Last active December 10, 2015 04:58
Show Gist options
  • Save bluepnume/4384862 to your computer and use it in GitHub Desktop.
Save bluepnume/4384862 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<script type="text/x-handlebars">
{{#view CounterView}}
Counter: {{Counter.value}}
<button {{action "increment"}}>Add 1</button>
{{/view}}
</script>
<script src="jquery-1.7.2.min.js"></script>
<script src="handlebars-1.0.rc.1.min.js"></script>
<script src="ember-1.0.pre.min.js"></script>
<script>
Counter = Ember.Object.create({
value: 1,
})
CounterView = Ember.View.extend({
increment: function(event) {
Counter.incrementProperty('value');
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment