Angular interpret {{}} inside a link function of a custom directive
angularjs, angularjs-directive, directive
Solution
In order to interpret the string, you need to interpolate it thanks to the angular's `$interpolate` service.
Example:
link = (scope, element, attrs) =>
interpretedString = $interpolate(element.text())(scope)
Problem
Is there a way to interpret the content of a div having my directive as an attribute : example : ``` <div my-directive>{{1+1}}</div> ``` and my link function looks like this : ``` link = (scope, element, attrs) => interpretedString = element.text() ``` in this example `interpretedString` is equal to `{{1+1}}` instead of 2 any help? the `scope.$eval` evaluates attributes, but what if I want to evaluate the text of a directive? thanks