Issue
I have object JS was returned by AJAX. In this object there is field map that contents JS code.
When I do: {{data.map.js}} in template HTML, it gives me text instead working JS code.
This is code in template:
{{data.map.js}}
{{data.map.html}}
Object from response Ajax (short code):
map { html: "<div id="map_canvas" style="width:566px; height:310px;"></div>"
js: "↵ <script type="text/javascript">↵...}
Solution
Angular documentation suggests you may be able to execute js code via eval(). I have not done this personally but take a look at https://docs.angularjs.org/guide/expression
Answered By - Chintana Meegamarachchi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.