how to resolve the 'unknown provider' angular injectr error when adding third party angular directives to angular-meteor app

483 views Asked by At

I needed to add angular-file-upload directive to my meteor/angular app, which uses angular-meteor library.

I was able to find that package already converted as meteor smart package.

The installation instructions for this packege say:

 "meteor add netanelgilad:angular-file-upload"

I did exactly that.

Now, that I start the app, I get

[$injector:unpr] Unknown provider: FileUploaderProvider <- FileUploader <- FileUploadController

Here is my controller, which uses that provider:

'use strict';

// FileUploadController controller
angular.module('socially').controller('FileUploadController',
    ['$scope', '$http', '$stateParams', '$location', 'FileUploader',
        function($scope, $http, $stateParams, $location, FileUploader) {

            $scope.uploadUrl = '';

            var url = 'http://dctool-lnx.cloudapp.net:3001/api/files';

            var uploader = $scope.uploader = new FileUploader({

            });
        }
    ]);

What can I do to make this provider recognized?

1

There are 1 answers

0
Eugene Goldberg On

The resolution was: I forgot to add angularFileUpload as a dependancy to my angular app module. Once added, the error went away.