0

I'm using the Reusable Click to Edit Directive from Icelab. I've used it successfully in several places in my app, but I run into problems when I try to edit elements that are inside other directives.

As the directives are calling the elements one by one, as in the following code:

<my-continent text='{{questions.n2A.answer.1.name}}' continent-id="1"></my-continent>

I don't see how can I implement the reusable directive in them, as it generates a general block of html code, not a specific one for each element called with the directive my continent.

I've created a Plunker where the problem is visible.

If I add the click-to-edit directive into my-continent, it breakes. You can see what I mean on line 47 of the html, when I add click-to-edit="questions.n2A.answer.1.name" onto the line as shown under.

 <my-continent text='{{questions.n2A.answer.1.name}}' continent-id="1" click-to-edit="questions.n2A.answer.1.name"></my-continent>

Any idea about what am I missing?

Thanks!

Eric Mitjans
  • 2,149
  • 5
  • 40
  • 69

1 Answers1

1

I've used your plunker to check your problem and the moment I added click-to-edit to myContinent I've got an error in console linking to this:

Error on AngularJS

So basicly your code is not working because you create new scope in both directives. Hope that helps

maurycy
  • 8,455
  • 1
  • 27
  • 44