preserve angular directives' scope so it will be available after undo