Removed (re)compiling of element, as it is unnecessary and actually causes problems when the contents contains an ng-repeat.