I am creating a file upload directive which uses the following markup.
<file-upload
name="myUploader"
upload-url="{{$root.apiSettings.apiUrl}}/files"
auto-upload="true"
></file-upload>
I am trying to get the upload-url attribute in the directive controller like this.
$scope.uploadUrl = $attrs.uploadUrl
Obviously this doesn't work as I just get the un-evaluated expression with the curly braces in it. I tried using $scope.$eval to evaluate it but I got a parse error saying { was an invalid character at column 2.
Next i tried using ng-attr-upload-url with and without using $eval on it.
I'm generally trying to avoid using isolate scope bindings which would probably do the trick because most of the attributes in my directives are simple one time, one way bindings and I want to cut down on the number of watches so if this can be achieved using the humble $attrs collection I'd love to know how.