working through angular js reference implementation