Converted Jquery app to angularJS