- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 06:35 AM
I am unable to access an Angular Provider in the Service Portal. I tried several OOTB providers just for grins to no avail.
When I add a Provider to the client script:
function ($scope, $http, spUtil, spAttachmentManager) {
and try to access the portal page I get the following error:
Error: [$injector:unpr] Unknown provider: spAttachmentManagerProvider <- spAttachmentManager
Our current build: MID buildstamp: helsinki-03-16-2016__patch7-11-02-2016_11-08-2016_1607
Here is a related thread but I do not see a resolution for the issue:
Using Angular Service Providers in Service Portal
There was an issue opened up on github but closed without resolution: https://github.com/service-portal/documentation/issues/187
It details a workaround but I could not get it to work.
try {
angular.module('ng_spd').config(function(lazyLoaderProvider, $provide, $compileProvider, $controllerProvider){
lazyLoaderProvider.set({
register: $controllerProvider.register,
directive: $compileProvider.directive,
factory: $provide.factory,
value: $provide.value,
service: $provide.service
});
});
}catch(e){}
If I use the code as is I get the following error:
Error: [$injector:nomod] Module 'ng_spd' is not available! You either misspelled the module name or forgot to load it.
I am not sure how to add a module to a client script.
If I change the module name to 'sn.$sp', I no longer get the module error but still get the unknown provider error.
Any help would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2017 09:00 AM
User error...I misread the error message. I was trying to use $scope in a service. I should know better. My Angular is a little rusty.
I removed $scope and everything works fine. Not sure if I should mark this as correct seeing how it was my mistake to begin with.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 07:30 AM
Bryan, could this be because spAttachmentManager is a Directive, rather than a Factory or Service? I think you'd include that in your HTML, rather than in the Client Script.
When I tested this out with another OOTB provider, RPService, it worked just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 07:51 AM
Actually, that was just a poor example on my part. I originally experienced the issue with a custom Angular Provider service I created.
I get the same error:
Error: [$injector:unpr] Unknown provider: $scopeProvider <- $scope <- spFileUpload

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 08:39 AM
To confirm, you've related your Angular Provider to your Widget using the related list?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2017 09:23 AM