Sometimes you need to modify a two way binded attribute value prior to use it in the directive. This can't be done in the directive controller, because the attribute assignment is done after the controller is executed.
The link function is able to access the attributes directly but unfortunately a two way binded attribute expression isn't yet evaluated a that time.
The solution is to process the attribute in a scope.$watch function where the value will be evaluated automatically.
http://jsfiddle.net/gh/gist/angularjs/1.2.1/d60d9416f2206c6e3407/