Created
February 4, 2015 21:47
-
-
Save jedfoster/769162679f5238a49bd1 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/hosadu
This file contains hidden or 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
<!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> |
This file contains hidden or 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
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