javascript - AngularJS: Error when injecting $modal inside a controller that is nested inside of a directive -
we have custom directive generates html around checkbox. uses transclusion inject contents passed within it. looks this: somecheckbox.js angular.module('namespace.directives') .directive('somecheckbox', function() { return { templateurl: 'directives/checkbox.html'; restrict: 'e', transclude: true } }]); directives/checkbox.html <label class="styling" ng-transclude> ... other html </label> we extensively use modals throughout our application , in process of converting bootstrap's angular directive. we've created controller handles particular type of modal appears sporadically throughout out application: angular.module('namespace.controllers').controller('legalmodalcontroller', ['$scope', '$modal', function($scope, $modal) { $scope.showlegalmodal = function(title, legaltextlocation) { $modal.open({ templateurl: 'modals/legal.html',...