0
This is a piece of html:
<tr ng-repeat="projeto in projetos">
<td>{{projeto.name}}</td>
<td>{{projeto.status}}</td>
</tr>
It uses a controller that does the following function
$http.get('system/project/listProjectsPerUser')
.then(function (response){
if(response.data.success){
$scope.projetos = response.data.projects;
console.log($scope.projetos);
}
else{
console.log('Erro');
}
});
My question is the following, if it would be interesting to put this html as a directive and use the directive itself to perform the same function of the controller, to fill the array projects and display the html.