0

I have the following arrangement to fetch helptexts from a single Coffeescript file.

Coffeescript:

help.ex: '{{example.variable}} identifies enterprise data centers'

HAML:

%example-directive(attr='{{help.ex}}')

Now the example.variable is accessible but it is not getting interpolated on the view. This I guess is happening because the string as a whole is getting interpolated and compile is not running on the variables within. How do I get around this?

1 Answer 1

1

You can use the $interpolate service:

var exp = $interpolate(attrs.attr) // interpolate your attriubte
var interpolated = exp(scope) // evaluate it with the scope variable

Check this plunker

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.