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

Error using ngOptions with objects containing circular references #11372

Closed
@dubejf

Description

@dubejf

The new ngOptions in Angular 1.4-beta doesn't handle objects containing circular references well.

Steps to reproduce:

  1. Define a ng-options with ng-model. At least one of the items in the source array must be a recursive object (such as a Breeze entity).
  2. Select the recursive object.
  3. Uncaught RangeError: Maximum call stack size exceeded is printed on the console.

http://jsfiddle.net/dubejf/tn102eh8/ (using 1.4.0-beta6)

The watcher of ngModel, set by the ngOptionsDirective, compares the selected item with the last value by deep equality (using angular.equals). When a recursive object is selected, this causes the stack to blow up (as described in #7724).

Using track by doesn't alleviate the problem.

This error is not reproducible in Angular 1.3.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions