working with apply at angular