dist/smart-area.js
function triggerDropdownAutocomplete(){
                // First check with the autocomplete words (the ones that are not objects
                var autocomplete = [],
                    suggestions = [],
                    text = $scope.areaData,
                    position = getCharacterPosition(),
                    lastWord = text.substr(0, position).split(/[\s\b{}]/);

                // Get the last typed word
                lastWord = lastWord[lastWord.length-1];

                $scope.areaConfig.autocomplete.forEach(function(autoList){
                    autoList.words.forEach(function(word){
                        if(typeof(word) === 'string' && autocomplete.indexOf(word) < 0){
                            if(lastWord.length > 0 || lastWord.length < 1 && autoList.autocompleteOnSpace){
                                autocomplete.push(word);
                            }
                        }
                    });
                });

                if ($scope.areaConfig.dropdown !== undefined){
                    $scope.areaConfig.dropdown.forEach(function(element){
                        if(typeof(element.trigger) === 'string' && autocomplete.indexOf(element.trigger) < 0){
                            autocomplete.push(element.trigger);
                        }
                    });
                }

                // Now with the list, filter and return
                autocomplete.forEach(function(word){
                    if(lastWord.length < word.length && word.toLowerCase().substr(0, lastWord.length) === lastWord.toLowerCase()){
                        suggestions.push({
                            display: $sce.trustAsHtml(word),
                            data: null
                        });
                    }
                });

                $scope.dropdown.customSelect = null;
                $scope.dropdown.current = 0;
                $scope.dropdown.content = suggestions;
            }
function triggerDropdownAutocomplete(){
                // First check with the autocomplete words (the ones that are not objects
                var autocomplete = [],
                    suggestions = [],
                    text = $scope.areaData,
                    position = getCharacterPosition(),
                    lastWord = text.substr(0, position).split(/[\s\b{}]/);

                // Get the last typed word
                lastWord = lastWord[lastWord.length-1];

                $scope.areaConfig.autocomplete.forEach(function(autoList){
                    autoList.words.forEach(function(word){
                        if(typeof(word) === 'string' && autocomplete.indexOf(word) < 0){
                            if(lastWord.length > 0 || lastWord.length < 1 && autoList.autocompleteOnSpace){
                                autocomplete.push(word);
                            }
                        }
                    });
                });

                if ($scope.areaConfig.dropdown !== undefined){
                    $scope.areaConfig.dropdown.forEach(function(element){
                        if(typeof(element.trigger) === 'string' && autocomplete.indexOf(element.trigger) < 0){
                            autocomplete.push(element.trigger);
                        }
                    });
                }

                // Now with the list, filter and return
                autocomplete.forEach(function(word){
                    if(lastWord.length < word.length && word.toLowerCase().substr(0, lastWord.length) === lastWord.toLowerCase()){
                        suggestions.push({
                            display: $sce.trustAsHtml(word),
                            data: null
                        });
                    }
                });

                $scope.dropdown.customSelect = null;
                $scope.dropdown.current = 0;
                $scope.dropdown.content = suggestions;
            }
function triggerDropdownAutocomplete ( ) { // First check with the autocomplete words (the ones that are not objects var autocomplete = [ ] , suggestions = [ ] , text = $scope . areaData , position = getCharacterPosition ( ) , lastWord = text . substr ( 0 , position ) . split ( / [\s\b{}] / ) ; // Get the last typed word lastWord = lastWord [ lastWord . length - 1 ] ; $scope . areaConfig . autocomplete . forEach ( function ( autoList ) { autoList . words . forEach ( function ( word ) { if ( typeof ( word ) === 'string' && autocomplete . indexOf ( word ) < 0 ) { if ( lastWord . length > 0 || lastWord . length < 1 && autoList . autocompleteOnSpace ) { autocomplete . push ( word ) ; } } } ) ; } ) ; if ( $scope . areaConfig . dropdown !== undefined ) { $scope . areaConfig . dropdown . forEach ( function ( element ) { if ( typeof ( element . trigger ) === 'string' && autocomplete . indexOf ( element . trigger ) < 0 ) { autocomplete . push ( element . trigger ) ; } } ) ; } // Now with the list, filter and return autocomplete . forEach ( function ( word ) { if ( lastWord . length < word . length && word . toLowerCase ( ) . substr ( 0 , lastWord . length ) === lastWord . toLowerCase ( ) ) { suggestions . push ( { display : $sce . trustAsHtml ( word ) , data : null } ) ; } } ) ; $scope . dropdown . customSelect = null ; $scope . dropdown . current = 0 ; $scope . dropdown . content = suggestions ; }
Trigger a simple autocomplete, this checks the last word and determines
whether any word on the autocomplete lists matches it
Trigger a simple autocomplete this checks the last word and determines whether any word on the autocomplete lists matches it