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

后端 未结 12 1189
梦如初夏
梦如初夏 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:21

    I've encountered oddities like that with directive and table elements. See this issue for example. Try wrapping your template with div tag or use replace:false.

提交回复
热议问题