Move preview to a directive