
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2017 09:16 AM
I have a widget that display a set of items in an ng-repeat. Within those blocks I want to embed another widget and pass a unique sysid to this child widget. I have tried with the options parameter on the widget directive. And it works sort of. The problem is that all the child widgets get the same sysid passed even though I know what I try to pass is unique. All the child widgets displays the last sysid.
Anybody know how to do this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2017 07:55 AM
It sounds like you might have an issue with your loop, can you post your HTML template an example of the data you are looping through?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2017 06:27 AM
There are a few ways to do this. Have you tried any of the ways here:
https://serviceportal.io/docs/documentation/widget_embedded.md

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2017 07:55 AM
It sounds like you might have an issue with your loop, can you post your HTML template an example of the data you are looping through?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 01:58 AM
The issue was the way I imbedded the widget. I did it with variable subsitution to add the options within the html. When I initialized it from the server script instead then it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2018 11:00 AM
Hi, Tommy,
Could you share your resolution to achieve the issue?
I can't figure out how to pass a dynamic data in a loop on the parent widget to the embedded widget.
1. Here is my parent Widget HTML
<div class="panel panel-primary">
<div class="panel-heading">Suggested for you</div>
<div class="panel-body">
<div class="col-sm-6" ng-repeat="item in data.items ">
<h2 class="h4 m-t-none m-b-xs text-overflow-ellipsis" title="{{::item.name}}">{{::item.name}}</h2>
<widget id="user-favorite" options='{ "category": "SR", "sysid": "SYSID"}'></widget>
<div class="text-muted item-short-desc">{{::item.short_description}}</div>
<button type="button" class="btn btn-default"> <a href="?id=sc_cat_item&sys_id={{item.sys_id}}" class="pull-left" tabindex="-1">${Request}</a></button>
</div>
</div>
</div>
where I would like to pass 'sysid' property on the options as {{item.sys_id}},rather than a fixed 'SYSID'. It bumped out when I use
<widget id="user-favorite" options='{ "category": "SR", "sysid": {{item.sys_id}}}'></widget>
I tried few different syntax to escape to pass JSON object through 'options'.
Appreciate your help in advance.
Moon 1