Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
brunodgarcia
Contributor II
Contributor II

Widget - API Not Working

Hi,

I'm trying to use the name of a dimension as a parameter for a clear button, but it only works if I set the name of the field using a static value:

<div class="lui-buttongroup">
<lui-button ng-click="app.field('FIELD_NAME').clear()"                                           >Clear WORKS OK!         </lui-button>
<lui-button ng-click="app.field('{{data.headers[0].qFallbackTitle}}').clear()">Clear DOESN'T WORK</lui-button>
</div>

If you include the ng-click parameter as text in the widged, you'll notice that the expression is parsed correctly.

Any guess why it doesn't work?

1 Solution

Accepted Solutions
Aiham_Azmeh
Employee
Employee

Hi,

 

In angularjs, for data binding, you don't need the double curly brace, this is used mostly for string expressions (https://docs.angularjs.org/guide/templates).

try:

<lui-button ng-click="app.field(data.headers[0].qFallbackTitle).clear()">Clear DOESN'T WORK</lui-button>
<!-- instead of -->
<lui-button ng-click="app.field('{{data.headers[0].qFallbackTitle}}').clear()">Clear DOESN'T WORK</lui-button>

 

I hope this helps,

View solution in original post

1 Reply
Aiham_Azmeh
Employee
Employee

Hi,

 

In angularjs, for data binding, you don't need the double curly brace, this is used mostly for string expressions (https://docs.angularjs.org/guide/templates).

try:

<lui-button ng-click="app.field(data.headers[0].qFallbackTitle).clear()">Clear DOESN'T WORK</lui-button>
<!-- instead of -->
<lui-button ng-click="app.field('{{data.headers[0].qFallbackTitle}}').clear()">Clear DOESN'T WORK</lui-button>

 

I hope this helps,