0

I have a directive with an isolate scope and its own controller. I'd like to pass a value from the parent scope and print out its value onto the markup. I thought I could merely pass it like this:

scope: {
    isoProp: '='
}

I set up watches on the link and controller, so I do see the value being passed properly. However, I don't know how to use that value on the markup itself.

I've set up a Plunker to illustrate my issue. On line 17 in index.html, I was expecting {{dirCtrl.isoProp}} or {{isoProp}} to print out the value that I passed in, but they don't seem to.

Can someone explain what I'm doing wrong?

tgxiii
  • 1,355
  • 1
  • 15
  • 19
  • You are not using the isolate scope in the right way. It is usually (always?) used with it's own template. See the related question and answer for [When writing a directive, how do I decide if a need no new scope, a new child scope, or a new isolate scope?](http://stackoverflow.com/questions/14914213/when-writing-a-directive-how-do-i-decide-if-a-need-no-new-scope-a-new-child-sc?rq=1) – JoseM Jun 20 '14 at 13:17

1 Answers1

0

You can try to put the markup to template like this:

template: '{{isoProp}}'