How to create a validation multi-type with ng-messages


Inspired by the facebook registration form, would create a field that was possible to insert e-mail or phone and my validation messages were personalized, brought the controller, for example.

<label class="item item-input item-stacked-label">
    <span class="input-label">Email</span>
    <input type="text" name="email_tel" placeholder=" ou 4199776565" />

<div class="form-errors" ng-show="signupForm.email_tel.$error && signupForm.$submitted" ng-messages="signupForm.email_tel.$error" ng-messages-include="templates/validations/signup-email_tel.html">

    <div class="form-error" ng-messages="signupForm.email_tel.$error" ng-messages-multiple>
        <div ng-message="required">
	    {{ ::validations.required }}
        <div ng-message="minlength">
	    {{ ::validations.minlength }}
        <div ng-message="maxlength">
	    {{ ::validations.maxlength }}


References: - ngMessages