Skip to content

Instantly share code, notes, and snippets.

@jedfoster
Created February 4, 2015 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedfoster/769162679f5238a49bd1 to your computer and use it in GitHub Desktop.
Save jedfoster/769162679f5238a49bd1 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v2.0.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.9.0/ember.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script type="text/x-handlebars">
{{ironMan}}
</script>
<script id="jsbin-javascript">
var App = Ember.Application.create();
App.Person = Ember.Object.extend({
// these will be supplied by `create`
firstName: null,
lastName: null,
fullName: function(delimiter) {
return this.get('firstName') + delimiter + this.get('lastName');
}.property('firstName', 'lastName')
});
var ironMan = App.Person.create({
firstName: "Tony",
lastName: "Stark"
});
console.log(ironMan.get('fullName', '+')); // "Tony Stark"
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"><\/script>
<script src="//builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v2.0.0.js"><\/script>
<script src="//builds.emberjs.com/tags/v1.9.0/ember.js"><\/script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script type="text/x-handlebars">
{{ironMan}}
<\/script>
</body>
</html></script>
<script id="jsbin-source-javascript" type="text/javascript">var App = Ember.Application.create();
App.Person = Ember.Object.extend({
// these will be supplied by `create`
firstName: null,
lastName: null,
fullName: function(delimiter) {
return this.get('firstName') + delimiter + this.get('lastName');
}.property('firstName', 'lastName')
});
var ironMan = App.Person.create({
firstName: "Tony",
lastName: "Stark"
});
console.log(ironMan.get('fullName', '+')); // "Tony Stark"</script></body>
</html>
var App = Ember.Application.create();
App.Person = Ember.Object.extend({
// these will be supplied by `create`
firstName: null,
lastName: null,
fullName: function(delimiter) {
return this.get('firstName') + delimiter + this.get('lastName');
}.property('firstName', 'lastName')
});
var ironMan = App.Person.create({
firstName: "Tony",
lastName: "Stark"
});
console.log(ironMan.get('fullName', '+')); // "Tony Stark"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment