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.
"Model did not stabilize" error for not changing variable #678
Closed
Description
Create ng-component with 2 variables:
@NgComponent(
selector: 'mycomponent',
templateUrl: 'mycomponent.html',
publishAs: 'ctrl',
applyAuthorStyles: true
)
class MyComponent {
List<bool> boolList = [false, true];
String url = "http://helloworld.com";
}
and create template for the component:
<div id="my-component">
<div ng-repeat="val in ctrl.boolList">
<div ng-if="!val">
<div ng-if="!val">
<a href="{{ctrl.url}}">Hello World</a>
</div>
</div>
</div>
</div>
Running the code will result into following error:
Model did not stabilize in 5 digests. Last 3 iterations:
!(val): true <= null
[[href={{ctrl.url}}]](ctrl.url): [http://helloworld.com] <= null
STACKTRACE:
#0 RootScope.digest (package:angular/core/scope.dart:475:11)
#1 RootScope.digest (package:angular/core/scope.dart:480:7)
#2 RootScope.digest (package:angular/core/scope.dart:480:7)
#3 apply (package:angular/core/scope.dart:251:19)
#4 _rootRun (dart:async/zone.dart:688)
#5 _rootRun (dart:async/zone.dart:689)
#6 _rootRun (dart:async/zone.dart:689)
#7 _ZoneDelegate.run (dart:async/zone.dart:417)
#8 NgZone._finishTurn (package:angular/core/zone.dart:95:21)
#9 NgZone._onRunBase (package:angular/core/zone.dart:60:43)
#10 _onRunUnary (package:angular/core/zone.dart:69:15)
#11 _ZoneDelegate.runUnary (dart:async/zone.dart:426)
#12 _CustomizedZone.runUnary (dart:async/zone.dart:631)
#13 _BaseZone.runUnaryGuarded (dart:async/zone.dart:546)
#14 _BaseZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:572)
Operating system: Ubuntu 12.04 LTS
Browser: Chromium (Dartium) Version 31.0.1650.48 (240209)
It looks like that the problem is in specifying the ctrl.url in the attribute of an html element. On the other this works:
<a href="">{{ctrl.url}}</a>
Also the ng-if parts doesn't need to be the same variable, but the order of true/false values should be the same.
Metadata
Metadata
Assignees
Labels
No labels