Check $$phase prior to $apply to avoid "$digest already in progress" errors.
Merge pull request #22 from oblador/master

Check $$phase prior to $apply to avoid "$digest already in progress" errors