trigger event in angularjs way