|Re: [angular.js] ng-bind-html-unsafe, dynamic form, model issues||Oliver Batchelor||7/3/12 10:19 PM|
I gave it a go using a $compile directive, have a look here:
The second text "Property Two:" doesn't show up, not sure why that is
exactly - but it works at least.
On Wed, Jul 4, 2012 at 1:27 AM, Jeremy Snyder <jeremy...@gmail.com> wrote:
> I am having a problem with adding in form elements dynamicly from a
> configuration obtained from a server. I am using ng-bind-html-unsafe, and
> the form renders perfectly, but I can't seem to figure out how to tie in an
> event handler so that when the element loads into the page, the form
> elements are compiled into the model.
> jsFiddle example: http://jsfiddle.net/j_snyder/ctyfg/
> Notice that property two and three don't update the model. I tried
> bootstrapping the parent div element, but I suspect a race condition, and
> don't know how to tie in an event handler to when the dom has been updated
> with the new html. Any help is appreciated.
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
|Re: [angular.js] ng-bind-html-unsafe, dynamic form, model issues||Oliver Batchelor||7/5/12 6:17 AM|
I guess normally you could generate the form from some data loaded as
JSON, probably more the 'angular way'.
Something like this:
Glad to help. Learning plenty myself.
On Fri, Jul 6, 2012 at 12:56 AM, j.snyder <jeremy...@gmail.com> wrote:
> Nice work! Would be nice if the bind html unsafe did a compile on the
> section, since that is essentially what you are doing, but this looks like a
> great option. Thanks again.
> Also, I noticed that if I started with an HTML tag and not Property Two, it
> rendered the whole block. Not sure why, but it works:
> This seems like it could be a pretty useful solution for others too, is
> there a reason why there isn't a built in ability to do this?