Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-select throws "Cannot read property 'selectedLabels' of undefined", suggest existence check first #7079

@jaGarcia

Description

@jaGarcia

Occurred in 1.0.4 and 1.0.5 that I've tested.

I have a function that updates the div the md-select is in with HTML pulled from the server. It looks like the old DOM element is being swapped out before this latent function fires. Suggest perhaps checking the existance first:

    function announceClosed(opts) {
      var mdSelect = opts.selectCtrl;
      if (mdSelect) {
        var menuController = opts.selectEl.controller('mdSelectMenu');
        **if(menuController) {**
             mdSelect.setLabelText(menuController.selectedLabels());
             mdSelect.triggerClose();
        **}**
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions