Answer the question
In order to leave comments, you need to log in
Why is the data not being passed to the modal window?
Good day!
Strange things are happening in my code. I need to transfer one variable to the modal window. I prescribe it in 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>
$('#dishCard').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget)
$scope.dish_id = button.data('whatever')
toastr.info('Dish.ID: '+button.data('whatever'))
});
$('#dishCard').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget)
$scope.dish_id = button.data('whatever')
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question