mhevery/angular.js — comment on commit 081663eb94079bff63c85234e3e6bda632bbe440
File: src/service/compiler.js line 419
By mhevery:

Well, that is not how it works. The $apply means that you are going from outside of angular into angular. This could would be inside of directive, which executes inside angular, so calling $apply is wrong, and will result in an error.

Your advice is good, but your suggestion is not correct. So what do you want to do?