I have the following issue:
In my controller I have something like:
$scope.current = 0;
And I have some directive who is looking like this:
angular.module('myAPP')
.directive('post', function() {
return {
restrict: 'EA',
replace: true,
scope: {
post: '=',
index: '='
},
link: function(scope) {
//update the $scope.current here
},
templateUrl: 'components/blog/post.html'
};
});
Can someone explain me whats the best way to do this, its possible to update the $scope inside the link function?
Thanks!