Skip to content

Changing local data? #250

@Siyfion

Description

@Siyfion

Does typeahead.js support changing of the local data array post-initialization while still getting the typeahead functionality for the newly inserted items?

I just tried to utilize this in my AngularJS app:

      $scope.addCountry = function () {
        $scope.exampleData.local.push({name:'XXX Test Place', code: 'XXX'});
      };

      // single dataset
      $scope.exampleData = {
        name: 'countries',
        valueKey: 'name',
        local: [
          {name: 'Afghanistan', code: 'AF'},
          {name: 'Åland Islands', code: 'AX'},
          {name: 'Albania', code: 'AL'},
          {name: 'Algeria', code: 'DZ'},
          {name: 'American Samoa', code: 'AS'},
          ...
       ]
     };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions