AngularJS Example:
by Guddu Kumar
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div ng-app>
<h2>Todo</h2>
<div ng-controller="TodoCtrl">
<pre>{{originalData|json}}</pre>
</div>
CSS
.done-true {
text-decoration: line-through;
color: grey;
}
JavaScript
function TodoCtrl($scope) {
$scope.ComplexSchema = [
{text:'learn angular', done:true,attributes: [
{
"text": "learn angular",
"done": true
},
{
"text": "build an angular app",
"done": false
}
]},
{text:'build an angular app', done:false}];
$scope.originalData = [{
id: "Schema",
parent: "#",
text: "Schema",
dataType: "",
attributes:[]
},
];
angular.forEach($scope.ComplexSchema, function(typeVal11){
$scope.originalData[0].attributes.push(typeVal11);
})
}