$compile + ngRepeat + replace templates (fix #2151)

Closes #2151