AngularJS directive that simulates the effect of typing on a text editor