Created
April 10, 2014 08:04
-
-
Save yoga1290/10354244 to your computer and use it in GitHub Desktop.
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> | |
<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> |
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({ | |
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