Utils and event driven implementation for AngularJS