RapidMod icon

AngularJs form.$valid debugging script

RapidMod | PRO | 02/13/19 08:49:11 PM UTC | 0 ⭐ | 390 👁️ | Never ⏰ | []
PHP |

580 B

|

None

|

0 👍

/

0 👎

<?php
/**
 * 
 * to use this script replace "form.$valid" and "form.$error" with the proper model
 * name in the html snippet below
 * IE <my_form_model_name>.$error and <my_form_model_name>.$valid
 * and then place the html snippet inside of the form
 * @packge @angulaJs
 * @author RapidMod.io
 */
?>
 
<ul ng-if="!form.$valid">
    <li ng-repeat="(key, errors) in form.$error track by $index"> <strong>{{ key }}</strong> errors
        <ul>
            <li ng-repeat="e in errors">{{ e.$name  }} has an error: <strong>{{ key }}</strong>.</li>
        </ul>
    </li>
</ul>

Comments