client side javascript, angular code