Hi Tan,
That is what I meant that you needed an extra controller! You don’t even
need the ng-Init anymore now.
change your controller a bit so it looks like this:
app.controller('assignmentCtrl', [
'$scope',
function($scope) {
//set up the empty array, so angular start with binding an empty array!
$scope.assignments = [];
// you can use the $scope variables from the parent scope in here!
$http.get('something.php?emp=' + $scope.employee + '&d=' + $scope.day)
.then(function(response) {
$scope.assignments = response.data;
});
}
]);
and your HTML:
<td class="calendar-unit" ng-repeat="day in days"
ng-controller='assignmentCtrl'>
{{day.date()}}
<div class="assignment" ng-repeat="assignment in assignments">
{{assignment.type}}
</div>
</td>
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.