Made util.$apply "safe" from being called within a digest cycle