How to add directive to widget serviceportal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2016 10:54 AM
Hi All,
I am trying my hands on serviceportal and new to angularjs.
I saw a video explaining how to include dependencies in widget. But it is not working.
So i am trying to pull data from table and display it and trying to do pagination using 3rd party "Pagination Directive"(angularUtils/src/directives/pagination at master · michaelbromley/angularUtils · GitHub ) . I have added the JS file under the dependency but not able to use it .
Can someone help on this. or let me know,do i need to do any other steps.
working code
<table class="rwd-table" style="background-color: white;">
<div class="searchResult" >
<tr ng-repeat="task in c.data.tasks">
<td>{{task.number}}</td>
<td>{{task.short_description}}</td>
<tr>
</div>
</table>
Added dependency
But when i tried the pagination it didnot .
<table class="rwd-table" style="background-color: white;">
<div class="searchResult" >
<tr dir-paginate="task in c.data.tasks" | itemsPerPage:5>
<td>{{task.number}}</td>
<td>{{task.short_description}}</td>
<tr>
</div>
</table>
Do i need to add anything in client script .
Client script:
function($scope) {
var c = this;
c.display = function() {
c.server.update().then(function(data) {
})
}
c.display();
}
Any help is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 06:20 AM
I you recommend reading the authors instructions on github:
https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 06:21 AM
I you recommend reading the authors instructions on github:
https://github.com/michaelbromley/angularUtils/tree/master/src/directives/pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2018 11:48 AM
Thanks Larstange, I as able to get it working. ended up having to change a couple of items in my client script because I am trying to do something somewhat unique, but still use the pagination as a filter.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2020 02:46 PM
Hey
I've been able to get the pagination directive to work as you have posted it, but I'm curious how you would get it to work as an angular provider (sp_angular_provider)? These records actually have a type option that allows directives, factories, and services.