Seeking some help. I am working with angular-ui-bootstrap alongside php and mysql. My goal is to pass a value from a list of links (dynamically generated from php mysql) to a modal button each time the modal is loaded.
HTML
// The link below is generated within a while-loop using php-mysql result
<a href="#" data-refno="<?php echo $r->wo_ref_no; ?>" ng-click="open()">Issue</a>
<script type="text/ng-template" id="SubmissionReminder.html">
<div class="modal-header">
<h3 class="modal-title">Submission Work Order Request</h3>
</div>
<div class="modal-body">
Please make sure that quotation(s) or any related document(s) for this Work Order are ready for the Procurement Unit to proceed accordingly.
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" ng-click="cancel()">Cancel</button>
<a href="issue.php?wo_ref={{ refno }}" class="btn btn-primary">Submit</a>
</div>
</script>
JS
app.controller('userWOController', function ($scope, $modal) {
$scope.animationsEnabled = true;
$scope.open = function () {
$scope.items = [];
var modalInstance = $modal.open({
animation: $scope.animationsEnabled,
templateUrl : 'SubmissionReminder.html',
controller: 'SubmissionReminder'
});
};
$scope.toggleAnimation = function () {
$scope.animationsEnabled = !$scope.animationsEnabled;
};
});
app.controller('SubmissionReminder', function ($scope, $modalInstance) {
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
});
I'm facing difficulty in passing the value from the trigger (a href) to the modal button (a href).