1

I want to define second template and controller for modal dialogue in Angular bootstrap UI. But system return an error [$injector:unpr] Unknown provider: itemsProvider <- items <- newCtrl

http://embed.plnkr.co/lox1ZkU516NRL445v9el/preview

Any one has idea about what this happens?

1 Answer 1

3

You have a typo in the object you're trying to resolve with - instead of item it should be items. The below function works (fixed Plunker):

$scope.openNew = function(size){
  var xmodal = $modal.open(
    {
     templateUrl: 'myModalContent.html',
     controller: 'newCtrl',
     resolve:{items: function(){return $scope.items;}}

    });

}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.