I\'m trying to implement custom sortBy directive in order to make columns in html table sortable.
HTML:
-
I know this is old, but there is another solution.
I encountered this issue also, and tried all the above solutions with no luck.
turns out, for some weird reason, that this error is thrown also in case there is a typo in the 'templateUrl' - if angular can't find the html file by the given path - you get the same 'must have exactly one root element' error.
so - fixing the templateUrl fixed the error for me.
hope this helps anyone in the future.
- 热议问题