モデル、ビュー、およびルーターを管理するために Backbone js を使用する PhoneGap アプリがあります。
電話連絡先のリストを表示するビューがあります。
電話連絡先は、PhoneGap API を使用して取得されます。
連絡先ビューのテンプレートは次のとおりです。
<script type="text/template" id="contacttemplate">
<div>
<dl>
<dt><%= displayName %></dt>
</dl>
</div>
</script>
ビューのレンダリング機能は次のとおりです。
render: function () {
var template = _.template($("#contacttemplate").html(),
JSON.stringify(this.model));
$(this.el).html(template);
return this;
}
モデルの型はContactです
しかし、次のエラーが表示されます
ReferenceError:「displayName」は定義されていません
ここで何が間違っている可能性がありますか?