0

Is there anyway I can use use ng-model within a transclusion of a directive?

I have posted the code here: http://plunker.no.de/edit/XWAUp7?live=preview

I look forward to somebody to give me advice.

4
  • 2
    It's related to: stackoverflow.com/questions/12629151/… Commented Nov 2, 2012 at 11:33
  • Thank you @Guillaume86. That works. Should I remove this topic? Commented Nov 2, 2012 at 14:12
  • No problem, yes I guess you can delete it since it's a duplicate Commented Nov 2, 2012 at 14:16
  • +1 Guillaume, here and in your actual answer. I answered before I saw your comment. Commented Nov 2, 2012 at 19:40

1 Answer 1

0

It's because you're passing around a primitive type. If you use a reference type, like an object or an array, it will work a lot better. I've changed your plunk here this demo

Notice I had to pass an object into fOuter to make it work. Likewise, on fInner, if the primitive is the child of an object, it works both ways.

EDIT: Looks like Guillaume86 answered in the comments. Same answer, really.

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.