events directive working