I have data of such objects:
var description = {3: {2015-3-17: 1, 2015-3-18: 0, Routine: "PASAY - CAGAYAN", TRIPCode: 3}, 4: {2015-3-17: 0 2015-3-18: 4 Routine: " PASAY Now I'm planning to display them in the table, but I'm not sure how to start from all the objects. I want to get the output that looks like this: tripcode | roulette | 2015-3-17 | 2015/03/18 | 3 | dice - cai Singing | 1 | 0 | 4 | Pays - Caveat | 0 | 4 |
Is there anyone to do this? I tried it but unfortunately it is not working.
Be sure to format your data object correctly, some key citations were not lost. Apart from this, the details should be restricted to $ range.
Try this:
< Preclass = "snippet-code-js lang-js prettyprint-override">
function myCtrl ($ scope) {$ scope.details = {'3': {tripcode: 3, "Pese - Cagayan", '2015 - 3 - 17 ': 1,' 2015 - 3 - 18 ': 0},' 4 ': {TRIPCode: 4, MUSTION: "Dice - cavete",' 2015 - 3 - 17 ': 0,' 2015 - 3 - 18 ': 4},}; }
.header, .items {border bottom: 1px solid # 000; Width: 600px; } .hader span, .imes span {display: inline-block; Width: 120px; Border-right: 1px solid # 000; Padding: 5px; }
& lt; Script src = "https://ajax.googleapis.com/ajax/libs/ AngularJS / 1.2.23 / angular.min.js" & gt; & Lt; / Script & gt; & Lt; Div ng-app & gt; & Lt; Div ng-controller = "MyCtrl" & gt; & Lt; Div ng-repeat = "detail in detail" & gt; & Lt; Div class = "header" ng-show = "$ index == 0" & gt; & Lt; Span ng-repeat = "(key, value) in detail" & gt; {{Key}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "item" & gt; & Lt; Span ng-repeat = "(key, value) in detail" & gt; {{Value}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;
No comments:
Post a Comment