angular code working with update loop