all code from the beginning angular js class