Added some classes and structure. Use ng-switch noe for template data item type