1

I have a parent and child directive. For some reason I can't pass information from the parent to the child. This jsfiddle demonstrates the issue I have.

The idea is as follows, the template of the parent directive looks like

<div>{{abc}}: <child msg="msg"></child></div>

As you can see, here I try to pass the msg value from the parent scope to the child, which should render the message, but inside the child directive this value is 'undefined.

Any suggestions how this can be fixed?

2
  • 1
    Your question seems cut-off prematurely. Could you add what seems to be missing at the end? Commented Sep 19, 2013 at 19:05
  • sorry, I fixed it (I was almost there :) Commented Sep 19, 2013 at 19:16

2 Answers 2

1

Here is the updated fiddle:

http://jsfiddle.net/NQgwQ/5/

Basically I removed the replace prop:

replace: true -> replace:false
Sign up to request clarification or add additional context in comments.

8 Comments

This is due to a bug, try it with newer lib. This answer doesn't make any sense. There is nothing to do with "replace".
Look at my fiddle. Does it work? It does. Here is a fiddle with what YOU suggested: jsfiddle.net/NQgwQ/9
@baby You are trying to fix something based on wrong thing. This is horrible.
@sza My fiddle works, you haven't provided a fiddle. Therefore, I am right.
@sza Besides, in the OP example fiddle, the angular version is already 1.1.1
|
0

You are loading 2 AngularJS frameworks. You can remove the external angular.js you added in the fiddle.

This is the updated demo: http://jsfiddle.net/4gusp/

7 Comments

Nope, it is the replace property.
@baba Nope, just follow my answer and try.
Nope, my fiddle works, I followed your example, it doesn't work. So, nope.
@baba Updated the my answer with the fiddle.
Updated your fiddle with version 1.03. jsfiddle.net/4gusp/1 Still works. So no bug in angular.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.