My controller looks something like this:
controller('MonthlyCalendarController', ['$scope', function($scope) {
$scope.counter = 0;
$scope.increment = function() {
$scope.counter++;
console.log($scope.counter);
}
}])
My HTML looks something like this:
<div ng-repeat="x in y track by $index" ng-init="increment()">
counter: {{counter}}
</div>
My output looks like this every time. It only ever shows "1":
<div>counter: 1</div>
It console.logs() correctly; logging incremental numbers. However, my HTML output is only "1" every time. Just outputting $index will not suffice, as I'm doing other math in my increment() function, and $scope.counter will != $index. Any ideas?