User Criteria in Widgets

charan_1
Tera Contributor

I need below html to be visible based on the user criteria. The sample code I have written is below

 

<div ng-if="data.userMatche='true'";> <h>text</h></div>

 

Server script is-

var userCriteria = ['6b6df061ff2121009b20ffffffffff44','0b5b0e6453631300afffddeeff7b1201'];

var userMatche = sn_uc.UserCriteriaLoader.userMatche(gs.getUserID(), userCriteria);

 

But I was not able to see the html content.

Can anyone please help me with this?

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@charan_1 I see a missing character in userMatches method update your code as follows.

 

var userCriteria = ['6b6df061ff2121009b20ffffffffff44','0b5b0e6453631300afffddeeff7b1201'];
var userMatches = sn_uc.UserCriteriaLoader.userMatches(gs.getUserID(), userCriteria);
gs.info(userMatches);

The code you pasted misses character 's' in userMatches method, in your code you wrote sn_uc.UserCriteriaLoader.userMatche(gs.getUserID(), userCriteria) whereas it should be sn_uc.UserCriteriaLoader.userMatches(gs.getUserID(), userCriteria)

 

Hope this helps.

@Sandeep Rajput , Thanks for the response.

We have tried in that way also, still it is not working.

Can you please check and tell me where it was going wrong?