Tuesday, 15 May 2012

angularjs - Dynamically adding Angular ui-select to page -


After returning from an AJAX request, I am trying to add the dome element on the page. UI-selections are in the domain element, and I am getting this error:

  error: error: orphan orphan ngTransclude Directive  

I add content On the page like this:

  var childDiv = $ collection ('
_contents_

While UI-selection instructions in -contents - are below:

  & lt; P & gt; Selected: {{address selected.formatted_address}} & lt; / P & gt; & Lt; Ui-select ng-model = "address.selected" theme = "bootstrap" ng-disabled = "disabled" reset-search-input = "wrong" & gt; & Lt; Ui-select-match placeholder = "Enter an address ..." & gt; {{$ Select.selected.formatted_address}} & lt; / Ui-select-match & gt; & Lt; Ui-select-options repeat = "Address by Address $ Index" Refresh = "Refresh Credits ($ select.search)" Fresh-Delay = "0" & ​​gt; & Lt; Div ng-bind-html = "address.formatted_address | highlight: $ select.search" & gt; & Lt; / Div & gt; & Lt; / Ui-select-options & gt; & Lt; / Ui select & gt;  

How is it better to accomplish this?

I'm not sure how the page is setup but you can probably select the selected objects on that array $ The radius can be added to the array and ng-repeat , in this way, when you receive an Ajax response, you can do the .push item in that code, and ng-repeat it will take care of adding it to the dome and making it a child's scope.


No comments:

Post a Comment