javascript - AngularJS, insert predefined DOM element into html -
i have predefined canvas element in every element of results
array, use in ng-repeat
. need place canvas inside of every element of ng-repeat. {{result.canvas}}
didn't work , gives error. tried insert canvas via directives, without success.
every element in results
have bunch of data , 1 canvas dom element. e.g.: result.canvas = document.createelement("canvas");
and need insert canvas html:
<div class="result" data-ng-repeat="result in results" data-ng-if="!result.error"> <div class="result-image"> <div class="result-image-display"> <div data-ng-style="computestyle(result)"> {{result.canvas}} </div> </div>
which gives error: https://docs.angularjs.org/error/$interpolate/interr?p0=%0a%20%20%20%20%20%20%20%20%20%20%7b%7bresult.canvas%7d%7d%0a%20%20%20%20%20%20%20%20%20%20&p1=typeerror:%20converting%20circular%20structure%20to%20json
i need know how insert dom element html without getting error.
angular should have executed $interpolate replace double-curlies, , $interpolate in docs says parameter should string. canvas not string.
Comments
Post a Comment