Use scope.evalAsync to make sure the digest cycle is triggered.