I am new to angular and javascript (sort of) and am trying to figure out how I can register a handler to a bootstrap event in my controller.
I want to do something like this:
$('#mymodal').on('shown.bs.modal', function () {
$scope.password = undefined;
});
Firstly, I can't get jQuery to run within my controller. From my research I am getting a feeling that it is not recommended. Is this true? Also for educational purposes, how could I make jQuery run in my controller if I wanted to?
Secondly, I wrote the following as a replacement for jQuery:
var modal = document.getElementById(mymodal);
modal.addEventListener('shown.bs.modal', function () {
$scope.password = undefined;
}, false);
This doesn't work too. I think that 'shown.bs.modal'
is not being detected as yet. Any ideas why?
Do I need to require
the bootstrap.js
file to fix this?