I want to be able to trigger a function that when one of the form's inputs (not a specific one) is being clicked or focused (doesn't really matters)... then to set a background color for the model window that the form is in.
Here is the marks up
<md-dialog-content ng-style="{'background-color':newColor}">
<div class="md-dialog-content">
<form name="userForm" >
<div layout-gt-xs="row">
<md-input-container class="md-block" flex-gt-xs>
<label>Company</label>
<input ng-model="user.company">
</md-input-container>
<md-input-container>
<label>Enter date</label>
<input ng-model="user.date">
</md-input-container>
</div>
</form>
</div>
</md-dialog-content>
I've tried to listen to the event by Angular.element and also by jquery
angular.element(document.querySelectorAll('[name="userForm"]')).on('focus', function() {
$scope.newColor = 'red';
});
But - no luck,