Bind Angularjs to newly created html element dynamically

前端 未结 3 1694
心在旅途
心在旅途 2020-11-30 05:50

I have a tab page with multiple tabs that once clicked on call a service to return some data. Some of that data returns html forms and are very random. I want to collect t

3条回答
  •  猫巷女王i
    2020-11-30 06:32

    I have a dinamyc table with some ng-repeat's, then when I tried to fill one column with javascript callback function, it give me just in html text like

     "span class=someclass> some_text /span>" 
     "span class=someclass> some_text /span>" 
     "span class=someclass> some_text /span>" 
    

    So I resolved my problem with jquery:

    $(".tableListFilas td").each(function(){
       var td_class = $(this).attr("class");
         if(td_class == 'tableList_'+titulo)
         {
           **var toExtraHtml = $(this).text();**
           **$(this).html(toExtraHtml);**
         }
    });
    

    then the final output was good:

     some_text 
     some_text 
     some_text   
    

提交回复
热议问题