Search in sources :

Example 1 with ForTemplateNode

use of com.vaadin.flow.template.angular.ForTemplateNode in project flow by vaadin.

the class AngularTemplateParserTest method ngForElement.

@Test
public void ngForElement() {
    TemplateNode node = parse("<div><a class='item' *ngFor='let  item      of list'>{{item.text}}</a></div>");
    ForTemplateNode forNode = (ForTemplateNode) node.getChild(0);
    Assert.assertEquals("list", forNode.getCollectionVariable());
    Assert.assertEquals("item", forNode.getLoopVariable());
}
Also used : TextTemplateNode(com.vaadin.flow.template.angular.TextTemplateNode) ElementTemplateNode(com.vaadin.flow.template.angular.ElementTemplateNode) ForTemplateNode(com.vaadin.flow.template.angular.ForTemplateNode) TemplateNode(com.vaadin.flow.template.angular.TemplateNode) ForTemplateNode(com.vaadin.flow.template.angular.ForTemplateNode) Test(org.junit.Test)

Aggregations

ElementTemplateNode (com.vaadin.flow.template.angular.ElementTemplateNode)1 ForTemplateNode (com.vaadin.flow.template.angular.ForTemplateNode)1 TemplateNode (com.vaadin.flow.template.angular.TemplateNode)1 TextTemplateNode (com.vaadin.flow.template.angular.TextTemplateNode)1 Test (org.junit.Test)1