簡體   English   中英

自定義指令無法解析$ scope變量

[英]Custom directive not resolving $scope variable

我有一個自定義指令,但無法解析$ scope變量filterValue,如果我將其替換為實際值代碼,效果很好,

不起作用:-

<tableau-viz 
height="'500px'" url="'https://public.tableau.com/views/USMassShooting2013-2015TrendsPerState/Story1?:embed=y'" filters={{filterValue}}> </tableau-viz>

工作:-

<tableau-viz height="'500px'" url="'https://public.tableau.com/views/USMassShooting2013-2015TrendsPerState/Story1?:embed=y'" filters="{'field1':['item1', 'item2'], 'dateField':{'min':startDate, 'max':endDate}}"> </tableau-viz>

我為此創建了一個Jsfiddle,請您看看, https ://jsfiddle.net/iakash/rdrgvn3r/39/

提前致謝

如果要使用模板中的{{}}語法在指令中使用單向綁定來解析指令中的值,請更改指令對象:

過濾器:“ =”過濾器:“ @”

如果要傳遞模型並保持雙向綁定,請在模板中{{}}刪除您:

<tableau-viz height="'500px'" url="'https://public.tableau.com/views/USMassShooting2013-2015TrendsPerState/Story1?:embed=y'" filters="filterValue"> </tableau-viz>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM