refactored jquery into angular