Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Detaching <select> results in an exception #392

Closed
@goj

Description

@goj

Hi,
I have the following html:

    <button ng-click="attached = !attached">Toggle!</button>
    <div ng-if="attached">
      <select ng-model="irrelevant">
        <option>foo</option>
        <option>bar</option>
      </select>
      </div>
    </div>

Clicking the button, selecting "foo" and clicking a button again results in the following error:

The null object does not have a getter 'ngValue'.

NoSuchMethodError : method not found: 'ngValue'
Receiver: null
Arguments: []

With the following stack trace:

#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      _SingleSelectMode.onModelChange.<anonymous closure> (package:third_party/dart/angular/lib/directive/input_select.dart:185:78)
#2      _SelectMode._forEachOption (package:third_party/dart/angular/lib/directive/input_select.dart:146:24)
#3      _SingleSelectMode.onModelChange (package:third_party/dart/angular/lib/directive/input_select.dart:183:19)
#4      InputSelectDirective.dirty.<anonymous closure> (package:third_party/dart/angular/lib/directive/input_select.dart:76:28)
#5      relaxFnArgs.<anonymous closure> (package:third_party/dart/angular/lib/utils.dart:66:40)
#6      Scope.$eval (package:third_party/dart/angular/lib/core/scope.dart:385:43)
#7      $digest (package:third_party/dart/angular/lib/core/scope.dart:290:24)
#8      _rootRun (dart:async/zone.dart:688)
#9      _ZoneDelegate.run (dart:async/zone.dart:417)
#10     NgZone._finishTurn (package:third_party/dart/angular/lib/core/zone.dart:97:21)
#11     NgZone._onRunBase (package:third_party/dart/angular/lib/core/zone.dart:57:20)
#12     _onRunUnary (package:third_party/dart/angular/lib/core/zone.dart:66:22)
#13     _ZoneDelegate.runUnary (dart:async/zone.dart:426)
#14     _CustomizedZone.runUnary (dart:async/zone.dart:631)
#15     _BaseZone.runUnaryGuarded (dart:async/zone.dart:546)
#16     _BaseZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:572)

This has probably something to do with _inputSelectDirective.expando[_attrs.element] being set to null in OptionValueDirective.detach().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions