Created
May 29, 2017 11:24
-
-
Save DavorPadovan/7a36224c990219f48d7432e16c88fb57 to your computer and use it in GitHub Desktop.
// source http://jsbin.com
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.13.5/ember-template-compiler.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.13.5/ember.debug.js"></script> | |
<style id="jsbin-css"> | |
/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<h2>Currency converter</h2> | |
{{outlet}} | |
</script> | |
<script type="text/x-handlebars" data-template-name="index"> | |
Buy {{input type="number" value=model.usdValue}} USD | |
for {{input type="number" value=model.eurValue disabled=true}} EUR | |
</script> | |
<script id="jsbin-javascript"> | |
App = Ember.Application.create(); | |
App.Router.map(function() { | |
// put your routes here | |
}); | |
App.IndexRoute = Ember.Route.extend({ | |
model: function() { | |
return { | |
usdValue: 0, | |
eurValue: 0 | |
}; | |
} | |
}); | |
App.IndexController = Ember.Controller.extend({ | |
usdValueObserver: Ember.observer('model.usdValue', function() { | |
this.set('model.eurValue', (this.get('model.usdValue') * 0.89)); | |
}) | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"><\/script> | |
<script src="http://builds.emberjs.com/tags/v1.13.5/ember-template-compiler.js"><\/script> | |
<script src="http://builds.emberjs.com/tags/v1.13.5/ember.debug.js"><\/script> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<h2>Currency converter</h2> | |
{{outlet}} | |
<\/script> | |
<script type="text/x-handlebars" data-template-name="index"> | |
Buy {{input type="number" value=model.usdValue}} USD | |
for {{input type="number" value=model.eurValue disabled=true}} EUR | |
<\/script> | |
</body> | |
</html> | |
</script> | |
<script id="jsbin-source-css" type="text/css">/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">App = Ember.Application.create(); | |
App.Router.map(function() { | |
// put your routes here | |
}); | |
App.IndexRoute = Ember.Route.extend({ | |
model: function() { | |
return { | |
usdValue: 0, | |
eurValue: 0 | |
}; | |
} | |
}); | |
App.IndexController = Ember.Controller.extend({ | |
usdValueObserver: Ember.observer('model.usdValue', function() { | |
this.set('model.eurValue', (this.get('model.usdValue') * 0.89)); | |
}) | |
}); | |
</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
/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} |
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
App = Ember.Application.create(); | |
App.Router.map(function() { | |
// put your routes here | |
}); | |
App.IndexRoute = Ember.Route.extend({ | |
model: function() { | |
return { | |
usdValue: 0, | |
eurValue: 0 | |
}; | |
} | |
}); | |
App.IndexController = Ember.Controller.extend({ | |
usdValueObserver: Ember.observer('model.usdValue', function() { | |
this.set('model.eurValue', (this.get('model.usdValue') * 0.89)); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment