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

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

    i encounter the following error:

    Error: [$compile:tplrt] http://errors.angularjs.org/1.2.6/$compile/tplrt?p0=stockWidget&p1=stock.html.
    

    I get around by removing commement at very top of template file.

    replace is deprecated with angularjs 1.3 forward, the next release will remove it completely, it's better not to use replace key.

提交回复
热议问题