Angularified the code and removed jquery.