This is a html piece:
<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 as follows, if it would be interesting to put this html as a directive and use the directive itself to perform the same controller function, to fill the projects array and display the html. >