It's quite peculiar, I conducted a test using compile, prelink, and postlink along with extensive logging, and the results were unexpected:
function MyCtrl($scope) {
$scope.message = 'hello';
console.log('$scope.message set to hello');
}
app.directive('exampleDirective1', function() {
return {
restrict: 'E',
compile: function(tElement, tAttrs) {
console.log('currently at compile, attrs.min = ', tAttrs.min);
return {
post: function postLink(scope, elm, attrs) {
scope.$watch(function (){return attrs.min}, function (newValue, oldValue) {
console.log('currently, attrs.min = ', attrs.min);
});
console.log('currently at postlink, attrs.min = ', attrs.min);
},
pre: function prelink(scope,elm , attrs) {
console.log('currently at prelink, attrs.min = ', attrs.min);
}
};
}
};
});
http://jsfiddle.net/qdzLhpf9/
The value of scope is already assigned when prelink is executed. Nevertheless, it appears that the arguments are being evaluated between postlink and prelink.
EDIT:
Upon further investigation, it seems that in your version of Angular, $compile initializes args as 'undefined'. You can check this out in https://code.angularjs.org/1.0.0/angular-1.0.0.js at line 4434.