My guess is that you are obliterating the same element that the link 
function is being called with on this line:

> element.replaceWith(newForm);
>
Then, the next time the $watch function fires... BOOM!

its ugly, but try this:
...
                        $compile(newForm)($scope);
                        element.replaceWith(newForm);
                        element = newForm;
... 

On Wednesday, March 12, 2014 12:15:08 PM UTC+2, Fabian Andres wrote:
>
> hi there,
>
> I'm actually developing a dynamic form directive.
>
> based on a model I generate a form.
>
> The generation of this form works great.
> Clicking on the submit button sends the model to the server (for server 
> side validation).
> The server replies with the model, which now contains the server side 
> validation messages.
>
> In my directive, I'm watching ($watch) for changes in the model.
> Changes in my model causes a re-rendering of the form. But this doesn't 
> work.
>
> see http://jsfiddle.net/fabianandres/PwXQx/20/
>
> what am i doing wrong?
>
> thanks for any hints
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to