Use $apply() rather than $digest().