JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script>
<div ng-controller="MyCtrl">
<div ng-repeat="(keyC, column) in columns.form" ng-model="columns.form" >
<div class="well">
<p><strong>BLOCO {{ keyC }}</strong></p>
<div ng-repeat="(keyP, p) in column.perguntas" ng-model="column.perguntas" >
<formulario data="p" ></formulario>
</div>
</div>
</div>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
var columns = {
"id": null,
"nomeFormulario": null,
"nomeProjeto": null,
"form": [
{
"blockPos": 0.9126003134316232,
"perguntas": [
{
"hasNewBlock": true,
"number": 88888
}
]
}, {
"blockPos": 0.1231231313,
"perguntas": [
{
"hasNewBlock": true,
"number": 123123123
}
]
}
]
};
myApp.controller('MyCtrl', function($scope){
$scope.columns = columns;
});
myApp.directive("formulario", ['$compile', '$http', '$templateCache', function($compile, $http, $templateCache) {
return {
//template: '<section ng-bind-html="getTemplateUrl()"></section>',
scope: {
data: '=data'
},
restrict: 'AE',
link: function($scope, element, $attr) {
element.html('<div class="alert alert-danger">'+$scope.data.number+'</div>');
}
};
}]);