- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2016 11:34 PM
Hello,
I used the widget 'Ticket Attachments' in Service Portal of Helsinki.
In this widget there is an element which call 'now-attachments-list'.
I want to understand what the meaning of this element, maybe it's a directive of angular? so, where it's defined?
I would be happy if someone can explain me what is it exactly.
thanks,
Michal
Solved! Go to Solution.
- 10,930 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2016 03:53 AM
Michal,
I apologize that my answer was not clear. When I stated that it was on the ServiceNow side, I meant that it's not directly accessible to us. It's directly accessible to ServiceNow employees on their side. You won't find it under any Module, Angular Providers or dependency sections.
That said, it doesn't mean you can't get to it. With a closer look by doing an Inspection, you can see how the directive is defined.
Here is the directive script:
angular.module('sn.common.attachments').directive('nowAttachmentsList', function(getTemplateUrl) {
'use strict';
return {
restrict: 'E',
replace: true,
templateUrl: getTemplateUrl("attachments_list.xml"),
link: function(scope, elem, attrs, $parse) {
scope.icons = {
preview: attrs.previewIcon,
edit: attrs.editIcon,
delete: attrs.deleteIcon,
ok: attrs.okIcon,
cancel: attrs.cancelIcon
};
scope.listClass = "list-group";
var inline = scope.$eval(attrs.inline);
if (inline)
scope.listClass = "list-inline";
scope.entryTemplate = getTemplateUrl(attrs.template || "attachment");
}
};
});
;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2022 07:27 AM
Can you provide xmls or an update set to get the full codes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 11:48 AM
Hi
Sorry I don't have any of the updates saved. This post was done a few years ago.
However, all the pieces described here should be able to guide you through creating your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2021 12:08 AM
Hi
at which point is the attachments object build which is itterated in the ng_repeat of attachments_list.xml?
Is it somehow possible to add attributes (e.g. a custom field from sys_attachment) to the attachment object?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2022 02:21 AM
where is the attachment object defined? can it be extended adding fields?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 12:44 PM
The attachment object is defined in the client controller of the attachment widget. You should find the "setAttachments" function. Inside that function you should see $scope.attachment.