My modal has a windowTemplateUrl that looks like this:
<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}" data-ng-click="close($event)">
<div class="modal-dialog" ng-class="{'modal-sm': size == 'sm', 'modal-lg': size == 'lg'}">
<div class="modal-content square-btn">
<div class="modal-header custom-modal-header square-btn">
<button type="button" class="close" data-dismiss="modal" ng-click="cancel($event)">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h3 class="modal-title">{{modalTitle}}--</h3>
</div>
<div class="modal-body" modal-transclude>
</div>
</div>
</div>
</div>
Here is my JavaScript code:
$modal.open({
windowTemplateUrl: 'templates/common/modal.html',
templateUrl: 'templates/jobs/create-job-modal.html',
resolve: {
modalTitle: function(){
return 'Create new position';
}
},
controller: ['$scope', 'modalTitle', function( $scope, modalTitle ) {
$scope.modalTitle = modalTitle;
}]
});
It appears that I can't access my scope from the modal.html
template, but I can access it from the create-job-modal.html
template. How can I make it accessible in the modal.html template as well? Thank you for your help.