I am getting data from an api via $ http request. This is my controller.
angular.module('supernovaWebApp',['ui.router'])
.controller('professoresCtrl', ['$scope', '$http', function($scope, $http){
$http.get("http://localhost:3000/api/instructors/"+instructorId).success(function(data,status){
console.log(data);
$scope.professor = data;
});
};
}])
.config(function($stateProvider){
$stateProvider.state('instructor', {
url: '/instructor',
templateUrl: 'views/instructor.html',
controller: 'professoresCtrl'
});
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
TheobjectreturnswithouterrorandIcanobservetheobjectintheconsole,butitdoesnotrenderintheview.
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script><div><divclass="mdl-cell mdl-cell--4-col">
<div class="mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">{{professor.name}} {{professor.last_name}}</h2>
</div>
<div class="mdl-card__supporting-text">
<p>{{professor.profession}}</p>
<i class="material-icons md-18">phone</i> {{professor.phone}}
</div>
<div class="mdl-card__menu">
<button ng-click="delInstructor(instructor)" class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect" >
<i id="btn-archive" class="material-icons" >clear</i>
<span class="mdl-tooltip" data-mdl-for="btn-archive">
Arquivar
</span>
</button>
</div>
</div>
</div>
</div>