我目前開始學習如何使用Ember.js進行Web應用程序開發。目前有一些非常基本的東西,我還沒有實現。鏈接到www.google.com等外部網址。這是我有:如何使用LinkTo與HandelBars鏈接到外部URL
HTML
<body>
<script type="text/x-handlebars">
<div>
Hello, <strong>{{firstName}} {{lastName}}</strong>!
</div>
{{#linkTo google}}Google{{/linkTo}}
</script>
</body>
$(document).ready(function() {
//alert("HELLO WORLD");
window.App = Ember.Application.create();
App.ApplicationController = Ember.Controller.extend({
firstName: "Trek",
lastName: "Glowacki",
googleURL: "www.google.com/ncr"
});
App.Router.map(function() {
this.route("google", {
path: "www.google.com"
});
});
});
當鏈路使得它的工作,但它關係到這個地址:E:/EMBERJS/index.html#/www.google.com
任何提示將不勝感激。我不能相信我自己沒有想到這一點,但有一點外部幫助不會傷害。
問候,
牛年
爲什麼需要'linkTo'模板有特定的原因嗎?爲什麼不在純HTML中使用錨標籤? – Deif 2013-02-08 17:02:49