Ember,js linkTo demo
Ember.js starter app showing #linkTo param lookups
HTML
<script type="text/javascript" >
// Comment this line out and you will get a DEPRECATION
// warning, and an assertion that 'my_route' cannot be found
window.ENV = { HELPER_PARAM_LOOKUPS: true };
</script>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com.s3.amazonaws.com/ember-19271bcbdaca6f6369169c07603566d6b535c888.js"></script>
<script type="text/x-handlebars" data-template-name="application">
<h1>Application Layout</h1>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
<h2>Index Page</h2>
<p>This link goes to the route stored in the 'my_route'
property of the IndexController</p>
{{#linkTo my_route }}Test Page{{/linkTo}}
</script>
<script type="text/x-handlebars" data-template-name="test">
<h2>This is an AWESOME test page</h2>
{{#linkTo 'index'}}Go back{{/linkTo}}
</script>
CSS
* { font-family: sans-serif; }
h1 { font-size: 2em; margin-bottom: 1em;}
h2 { font-size: 1.5em; margin-bottom: 0.5em;}
JavaScript
App = Ember.Application.create();
App.Router.map(function() {
this.resource('test',{path: '/test'});
});
App.IndexController = Ember.Controller.extend({
my_route: 'test'
});