I'm building an Angular application and i'm using jquery to change an input class dynamically using focusin and focusout events, as you can see in the code below:
$(".form-input").focusin(function(){
$(this).addClass("focus");
$(this).prev().addClass("label-focus");
});
$(".form-input").focusout(function(){
$(this).removeClass("focus");
$(this).prev().removeClass("label-focus");
});
My doubt is: I read in the angular docs that i should'nt use angular with jquery and that i should use databinding instead, but how can i do it?
.form-inputelements on the HTML page across multiple components. This is why it's difficult to port jQuery to Angular. jQuery is selector based. Angular is component based. I think it's better to throw away all your jQuery code and just do it the proper Angular way.