Skip to content

Instantly share code, notes, and snippets.

@yoga1290
Created April 10, 2014 08:04
Show Gist options
  • Save yoga1290/10354244 to your computer and use it in GitHub Desktop.
Save yoga1290/10354244 to your computer and use it in GitHub Desktop.
<!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>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<script type="text/x-handlebars" data-template-name="index">
{{#link-to 'test' 1}}
Send 1 to the dynamic segment
{{/link-to}}
<br>
{{#link-to 'test' 2}}
Send 2 to the dynamic segment
{{/link-to}}
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="test">
</script>
</body>
</html>
App = Ember.Application.create({
LOG_TRANSITIONS: true
});
App.Router.map(function(){
this.route('test',{path:'dynamicSegment/:myparam'});
});
App.TestRoute=Ember.Route.extend({
model:function(p)
{
alert(p.myparam+" was recieved");
this.transitionTo('index');
return {};//nothing
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment