JSFiddle - React, Tailwind, and code Playground

by Jeff

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-rc.2/angular.min.js"></script>
<div ng-app="app">
    <div ng-controller="testController as test">
        <ul ng-if="test.type == 'multi'" ng-repeat="(hero, item) in test.list">
            {{hero}}
            <li ng-repeat="(k, v) in item">
                {{k}}: {{v}}
            </li>
        </ul>
        <ul ng-if="test.type == 'single'">
            <li ng-repeat="item in test.list">{{item}}</li>
        </ul>
    </div>
</div>

JavaScript

var app = angular.module("app", []);

app.controller("testController", function(){
   this.name = "Jeff";
   // this.type = "multi";
    this.list = {"Jeff": {"h": "1", "m": "1"}, "Eric": {"h": "1", "m": "1"}, "Will": {"h": "1", "m": "1"}};
    //this.type = "single";
    //this.list = [1,2,3,4,5,6];
    angular.forEach(this.list, function(v, k){
        if(typeof v === 'object'){
            this.type = 'multi';
        }else{
            this.type = 'single';
        }
    });
});