AngularJS directive for word counting