AngularJS: 'Template for directive must have exactly one root element' when using 'th' tag in directive template

后端 未结 12 1138
梦如初夏
梦如初夏 2020-12-30 19:50

I\'m trying to implement custom sortBy directive in order to make columns in html table sortable.

HTML:


   
            


        
12条回答
  •  醉梦人生
    2020-12-30 20:33

    This isn't your case, but I had this very same issue because my code had html comments before and after the template markup, like so:

    
    
    [...]

    I got rid of the comments and voilá - problem solved.

提交回复
热议问题