Skip to content

Instantly share code, notes, and snippets.

@yoga1290
Created March 31, 2014 11:15
Show Gist options
  • Save yoga1290/9890081 to your computer and use it in GitHub Desktop.
Save yoga1290/9890081 to your computer and use it in GitHub Desktop.
body {
font-family: Helvetica, Arial, sans-serif;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<script type="text/x-handlebars" data-template-name="index">
{{textarea value=mytext}}
<br>
{{mytext}}
<br>
{{len}}
<br>
{{textTemplateCantSee}}
</script>
</body>
</html>
App = Ember.Application.create({
LOG_TRANSITIONS: true
});
App.IndexRoute=Ember.Route.extend({
textTemplateCantSee:"Only you can see me"
});
App.IndexController=Ember.ObjectController.extend({
mytext:'',
len:function(){
return "length= "+this.get('mytext').length;
}.property('mytext')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment