Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

typeahead directive's properties can't be dynamic #1533

Closed
@zzal

Description

@zzal

Hi,

Since some options are set private within the link function of the typeahead directive, they are not binded.
For instance, if I set a property:

typeahead-editable="isAtLeastAdmin()"

or:

typeahead-editable="{{ isAtLeastAdmin() }}"

The changes in the result of the $scope.isAtLeastAdmin function are never passed to the directive.

So what I suggest is to not set theses options in private variables.
I can attempt what I'm trying if I change line 169 of src/typeahead/typeahead.js:

  if (originalScope.$eval(attrs.typeaheadEditable) !== false) {
    return inputValue;
  } else {

and use it like this: typeahead-editable="isAtLeastAdmin()"

Maybe I should make a pull request, or someone have an idea for a better implementation?

Thanks!

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