converted some jquery code to angular