我正在嘗試獲取要在{{if}}標記中使用的數據項的值,但無法使其正常工作。所以,問題是我們如何獲得這個價值?你可以在這裏看到完整的代碼http://jsfiddle.net/epitka/BhYvh/如何獲取要在{{if}}中使用的數據項的值?
<script id="contentHeaderTemplate" type="text/x-jquery-tmpl">
{{if($data.Id===1)}} Create New Order{{else}}Edit Order {{/if}}
<br />
</script>
如何獲取jquery模板中的所有實體數據這個$數據一直很有用。 $ {JSON.stringify($數據)} – Thulasiram 2012-10-18 10:07:17