JSFiddle - React, Tailwind, and code Playground
by GruffBunny
HTML
<div ng-app='MyModule' ng-controller="MyController">
<div ng-repeat="question in questions2 | orderBy:'position[0]'">
<p>{{question.Question.description.default}} - position: {{question.position[0]}}</p>
</div>
</div>
JavaScript
angular.module('MyModule', [])
.controller('MyController', function( $scope ) {
$scope.questions = [ { "Question" : { "description" : { "default" : "hello" },
"options" : [ { "value" : { } } ],
"title" : { "default" : "hello world" }
},
"Selection" : "text",
"position" : [ 0,
12,
0
]
},
{ "Question" : { "description" : { "default" : "hello 3" },
"options" : [ { "value" : { "default" : "1" } },
{ "value" : { "default" : "2" } }
],
"title" : { "default" : "hello 3" }
},
"Selection" : "radio",
"position" : [ 2,
12,
0
]
},
{ "Question" : { "description" : { "default" : "hello 2" },
"options" : [ { "value" : { } } ],
"title" : { "default" : "hello 2" }
},
"Selection" : "paragraph",
"position" : [ 1,
12,
0
]
},
{ "Question" : { "description" : { "default" : "hello 4" },
"options" : [ { "value" : { "default" : "check11" } },
{ "value" : { "default" : "check22" } }
],
"title" : { "default" : "hello 4" }
},
"Selection" : "checkbox",
"position" : [ 3,
12,
0
]
},
{ "Question" : { "description" : { "default" : "hello 5" },
"options" : [ { "value" : { "default" : "list1" } },
{ "value" : { "default" : "list2" } }
],
"title" : { "default" : "hello 5" }
},
"Selection" : "list",
"position" : [ 4,
12,
0
]
}
];
});