I am attempting to write a configurable directive that is applied to an input element, which requires ngModel, and which adds a parser and a formatter function for ngModel.
The problem I'm having is that I can't seem to pass interpolated values into the directive while simultaneously supporting ngModel binding. For instance, I want to be able to use my directive in one of two ways: by passing literal arguments (e.g. my-directive="120"), or interpolated arguments (e.g. my-directive="{{foo}}").
If I read the attributes argument of the link function in my directive definition, I can get the value of attributes.myDirective when I pass a literal, but when I attempt to use an interpolated value, myDirective is undefined. Now, if I add an isolated scope to the directive definition with myDirective: '@', then scope.myDirective is defined and interpolated in the scenarios above, but now ngModel is broken. My parser/formatter functions are passed undefined for their input arguments. Any ideas how I can fix this and support literal arguments and interpolated arguments and ngModel binding in the same directive?