I have created a reusable component but I keep getting issue if I don't pass resolve, what is wrong here.. thanks
$scope.open = function () { var modalInstance = $modal.open({ templateUrl: '../../App/template/commentsModal.html', size: '' , controller: ModalInstanceCtrl, resolve: { items: function () { return 'b'; } } }); But if I remove resolve then I keep getting [$injector:unpr] Unknown provider: itemsProvider <- items
What is items is this something internal to angularjs? here is the modal controller:
.controller('ModalInstanceCtrl', function ($scope, $modalInstance) { $scope.ok = function () { $modalInstance.close(); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; })
itemsyou must have listed as a dependency in the controller (though the pasted code doesn't seem like showing it), it is nothing but the name of the temporary service (items) that you have in the resolve..controller('ModalInstanceCtrl',function($scope,$modalInstance,items)modal.open.controller: 'ModalInstanceCtrl'