code: function addSelectedDropdownText(selectedWord, append){
  
                  $scope.dropdown.showFilter = false;
  
                  var text = $scope.areaData,
                      position = getCharacterPosition(),
                      lastWord = text.substr(0, position).split(/[\s\b{}]/),
                      remove = lastWord[lastWord.length - 1].length;
  
                  if(!append && $scope.dropdown.match){
                    remove = $scope.dropdown.match.length;
                  }
  
                  if(append || remove < 0){
                      remove = 0;
                  }
  
                  // Now remove the last word, and replace with the dropped down one
                  $scope.areaData = text.substr(0, position - remove) +
                      selectedWord +
                      text.substr(position);
  
                  // Now reset the caret position
                  if($element[0].selectionStart) {
                      $timeout(function(){
                          var caretPosition = position - remove + selectedWord.toString().length;
                          $element[0].focus();
                          $element[0].setSelectionRange(caretPosition, caretPosition);
                          checkTriggers();
                      }, 100);
                  }
  
              }
docs: /* +----------------------------------------------------+
  +                Internal Functions                  +
  +----------------------------------------------------+ 
  Add text to the textarea, this handles positioning the text
  at the caret position, and also either replacing the last word
  or appending as new content.
  
  @param selectedWord Word to add to the textarea
  @param append Whether it should be appended or replace the last word