Good day!
Strange things happen in my code. It is necessary for me to transfer one variable to a modal window. I prescribe it in the data-whatever links,
<a class="btn btn-default btn-xs" href="" data-toggle="modal" data-target="#dishCard" data-whatever="{{dish.id}}"> <i class="fa fa-info-circle fa-lg"></i> </a> I pass it through jQuery and the magic begins. If so:
$('#dishCard').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) $scope.dish_id = button.data('whatever') toastr.info('Dish.ID: '+button.data('whatever')) }); This is normal. If without a toaster, that is:
$('#dishCard').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) $scope.dish_id = button.data('whatever') }); then nothing is transmitted anywhere. I already broke my head, tell me why this is happening, what am I doing wrong? And is there a more reasonable way to send data to a modal window?