-
Notifications
You must be signed in to change notification settings - Fork 248
Getting type error from ng_repeat.dart #1089
Comments
Could you please give more details about this ? It should get a |
@chirayuk and @jbdeboer have the details, but basically this happens when the model bound to
When the type of |
That's something we can fix in angular.dart but it could also be fixed in client code: |
I don't understand your solution. Could you please use it on my example above? |
Vic is suggesting in the ctrl.isList case, you use "item in ctrl.getList()" instead of accessing data directly, and have the getList() function do a guard and either return a null (or const[]) if the data is not of type List. |
that's exactly what I was suggesting, let me know if anything is still unclear |
Good workaround. Should still be fixed in Angular. |
What do other thinks ? I would not say this is a bug |
How is the exception "type 'String' is not a subtype of type 'CollectionChangeRecord' of 'changes'" deep inside angular code not a bug? |
You're right, this is a bug, we have two ways to fix it:
To me getting someting other than a Thoughts ? |
Could you describe what it is that's wrong with the usage? |
The code is trying to iterate ( |
If you look at the example above, the user's code is not trying to iterate over a |
This must be due to the evaluation order that you can not control which is why a think throwing "ng-repeat can not iterate over a 'String'" could help. Notes:
|
@yjbanov I'm closing this issue as the last refactoring done for ng-repeat supports your use case (it would remove all rows when the subject is not Iterable). I'll create a separate issue to investigate why ng-repeat is evaluated when it should not. |
The type on the closure is wrong
https://github.com/angular/angular.dart/blob/a1d67aa9442a29b928950856f662b046468a6d5b/lib/directive/ng_repeat.dart#L134
The text was updated successfully, but these errors were encountered: