1

User clicks on videoClick

<div ng-repeat="list in lists" ng-click="videoClick(list.src)">
  {{list.src}}
</div>

This works and following executes.

 $scope.videoClick = function(val) {
   $log.info('received.');
   var modalInstance = $uibModal.open({
     size: 'lg',
     templateUrl: '/views/video_modal.html',
     animation: true,
     backdrop: false,
     controller: 'VideoController',
     resolve: {
       videoPath: function() {
         return val;
       }
     }
   });
 };

Now i am trying to get the value of 'videoPath' but i am getting an error.

Inside 'VideoController'

angular
  .module('tss.application')
  .controller('VideoController', function(videoPath) {
    "use strict";
  });

*

Any idea why i am not able to get the value of 'videoPath' inside 'VideoController' ?

*

6
  • What's your error ? Commented Nov 24, 2016 at 15:35
  • And can you try resolve: {videoPath: val} Commented Nov 24, 2016 at 15:36
  • angular.js:13424 Error: [$injector:unpr] Unknown provider: videoPathProvider <- videoPath <- VideoController Commented Nov 24, 2016 at 17:33
  • what is videoPath? if the is a directive, controller, service is it registered in the same module as "tss.aplication"? Commented Nov 24, 2016 at 19:43
  • Don't you have another function already called videoPath ? Commented Nov 25, 2016 at 8:55

1 Answer 1

0

Can you try

angular
  .module('tss.application')
  .controller('VideoController',['videoPath',function(videoPath) {
    "use strict";
  }]);
Sign up to request clarification or add additional context in comments.

1 Comment

Error: $injector:unpr Unknown Provider Unknown provider: videoPathProvider <- videoPath <- VideoController

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.