Default index-as = i

This commit is contained in:
Tobe O 2018-06-27 21:04:56 -04:00
parent f7245030cb
commit dd205ea693

View file

@ -180,7 +180,7 @@ class Renderer {
var indexAsAttribute = element.attributes var indexAsAttribute = element.attributes
.firstWhere((a) => a.name == 'index-as', orElse: () => null); .firstWhere((a) => a.name == 'index-as', orElse: () => null);
var alias = asAttribute?.value?.compute(scope)?.toString() ?? 'item'; var alias = asAttribute?.value?.compute(scope)?.toString() ?? 'item';
var indexAs = indexAsAttribute?.value?.compute(scope)?.toString() ?? 'item'; var indexAs = indexAsAttribute?.value?.compute(scope)?.toString() ?? 'i';
var otherAttributes = element.attributes.where( var otherAttributes = element.attributes.where(
(a) => a.name != 'for-each' && a.name != 'as' && a.name != 'index-as'); (a) => a.name != 'for-each' && a.name != 'as' && a.name != 'index-as');
Element strippedElement; Element strippedElement;