Jeanluca Scaljeri
Jeanluca Scaljeri

Reputation: 29109

angularjs: create directive inside directive

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?

Upvotes: 1

Views: 90

Answers (2)

zs2020
zs2020

Reputation: 54514

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/

Upvotes: 0

Nikola Yovchev
Nikola Yovchev

Reputation: 10216

Here is the updated fiddle:

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

Basically I removed the replace prop:

replace: true -> replace:false

Upvotes: 1

Related Questions