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

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

    I expect that the is getting melted away at some intermediate point when it is evaluated outside the context of a (put that template into some random part of your webpage to see the disappear).

    In your position, I would use a

    in the template, change sort-by-directive to an 'A' type directive, and use a ... as before, without replace: true.

提交回复
热议问题