Skip to content

The element value is not displayed using angular-keep-values #5

@amosrivera

Description

@amosrivera

Apparently the keep-current-value directive is added dynamically but the element is not compiled afterwards.

See the case example.

  function link(scope, element, attrs) {
    SUPPORTED_ELEMENTS.forEach(function(tagName){
      var checkElements = element.find(tagName);
      angular.forEach(checkElements, function(checkElement) {
        var checkElement = angular.element(checkElement);
        if ( angular.isDefined(checkElement.attr('ng-model')) ) checkElement.attr('keep-current-value', '');
      })
    });
  }

It can be fixed adding this line:

checkElement.replaceWith($compile(checkElement)(scope));

PR: #4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions