Skip to content

Instantly share code, notes, and snippets.

@anbublacky
Created October 19, 2014 07:16
Show Gist options
  • Save anbublacky/63f609e0eed3dceaabaf to your computer and use it in GitHub Desktop.
Save anbublacky/63f609e0eed3dceaabaf to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.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">
{{#linkTo 'makes'}}makes{{/linkTo}}<br />
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
</script>
<script type="text/x-handlebars" data-template-name="makes">
<div class="col-xs-12">
<div class="col-xs-4">
<ul>
{{#each model.makes }}
<li>{{#linkTo 'make' this}}{{name}}{{/linkTo}}</li>
{{/each}}
</ul>
</div>
{{outlet}}
</div>
</script>
<script type="text/x-handlebars" data-template-name="make">
<div class="col-xs-4">
{{#each model in model.models }}
<li>{{#linkTo 'model' model.id}}{{model.name}}{{/linkTo}}</li>
{{/each}}
</div>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="model">
<div class="col-xs-4">
Enter Your zipcode: {{ input type="text" value=zipcode }} {{#link-to 'spec' params}}Get spec{{/link-to}} </div>
</script>
<script type="text/x-handlebars" data-template-name="spec">
<div class="col-xs-4">
Enter Your zipcode: {{ input type="text" value=zipcode }} </div>
</script>
<script id="jsbin-javascript">
App = Ember.Application.create();
App.Router.map(function(){
this.resource('makes', function(){
this.resource('make', {path: ':make_id'}, function(){
this.resource('model', {path: ':model_id'});
});
});
this.resource('spec', {path: 'specification'})
});
App.IndexRoute = Ember.Route.extend({
model: function(){
}
});
App.MakesRoute = Ember.Route.extend({
model: function(){
return makes;
},
});
App.MakeRoute = Ember.Route.extend({
model: function(){
return makes[0];
}
});
App.ZipRoute = Ember.Route.extend({
});
App.ModelRoute = Ember.Route.extend({
model: function(){
}
});
App.SpecRoute = Ember.Route.extend({
model: function(){
}
});
makes = jQuery.getJSON('https://api.edmunds.com/api/vehicle/v2/makes?fmt=json&api_key=hg9m93hc23wpgarmu6j6qtyc&state=new&view=full');
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery.min.js"><\/script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"><\/script>
<script src="http://code.jquery.com/jquery.js"><\/script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.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">
{{#linkTo 'makes'}}makes{{/linkTo}}<br />
{{outlet}}
<\/script>
<script type="text/x-handlebars" data-template-name="index">
<\/script>
<script type="text/x-handlebars" data-template-name="makes">
<div class="col-xs-12">
<div class="col-xs-4">
<ul>
{{#each model.makes }}
<li>{{#linkTo 'make' this}}{{name}}{{/linkTo}}</li>
{{/each}}
</ul>
</div>
{{outlet}}
</div>
<\/script>
<script type="text/x-handlebars" data-template-name="make">
<div class="col-xs-4">
{{#each model in model.models }}
<li>{{#linkTo 'model' model.id}}{{model.name}}{{/linkTo}}</li>
{{/each}}
</div>
{{outlet}}
<\/script>
<script type="text/x-handlebars" data-template-name="model">
<div class="col-xs-4">
Enter Your zipcode: {{ input type="text" value=zipcode }} {{#link-to 'spec' params}}Get spec{{/link-to}} </div>
<\/script>
<script type="text/x-handlebars" data-template-name="spec">
<div class="col-xs-4">
Enter Your zipcode: {{ input type="text" value=zipcode }} </div>
<\/script>
</body>
</html></script>
<script id="jsbin-source-javascript" type="text/javascript">App = Ember.Application.create();
App.Router.map(function(){
this.resource('makes', function(){
this.resource('make', {path: ':make_id'}, function(){
this.resource('model', {path: ':model_id'});
});
});
this.resource('spec', {path: 'specification'})
});
App.IndexRoute = Ember.Route.extend({
model: function(){
}
});
App.MakesRoute = Ember.Route.extend({
model: function(){
return makes;
},
});
App.MakeRoute = Ember.Route.extend({
model: function(){
return makes[0];
}
});
App.ZipRoute = Ember.Route.extend({
});
App.ModelRoute = Ember.Route.extend({
model: function(){
}
});
App.SpecRoute = Ember.Route.extend({
model: function(){
}
});
makes = jQuery.getJSON('https://api.edmunds.com/api/vehicle/v2/makes?fmt=json&api_key=hg9m93hc23wpgarmu6j6qtyc&state=new&view=full');
</script></body>
</html>
App = Ember.Application.create();
App.Router.map(function(){
this.resource('makes', function(){
this.resource('make', {path: ':make_id'}, function(){
this.resource('model', {path: ':model_id'});
});
});
this.resource('spec', {path: 'specification'})
});
App.IndexRoute = Ember.Route.extend({
model: function(){
}
});
App.MakesRoute = Ember.Route.extend({
model: function(){
return makes;
},
});
App.MakeRoute = Ember.Route.extend({
model: function(){
return makes[0];
}
});
App.ZipRoute = Ember.Route.extend({
});
App.ModelRoute = Ember.Route.extend({
model: function(){
}
});
App.SpecRoute = Ember.Route.extend({
model: function(){
}
});
makes = jQuery.getJSON('https://api.edmunds.com/api/vehicle/v2/makes?fmt=json&api_key=hg9m93hc23wpgarmu6j6qtyc&state=new&view=full');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment