Use $apply instead of event hack.