angularjs directive with validation