I want to dynamic error message and can we show any message on success as well
.config
$validatorProvider.register = (name, object={}) -> ### Register the rule. @params name: The rule name. @params object: invoke: 'watch' or 'blur' or undefined(validate by yourself) init: function(scope, element, attrs, $injector) validator: RegExp() or function(value, scope, element, attrs, $injector) error: string or function(value, scope, element, attrs, $injector) success: function(value, scope, element, attrs, $injector) ###
.run
$validator.register = (name, object={}) ->
I want to dynamic error message and can we show any message on success as well
yes you can, use $attr
i have to use function in error and succuss method using $attr
$attr = "my message"; return $attr will show message ??
what is $attr ??
check https://docs.angularjs.org/api/ng/type/$compile.directive.Attributes
$attr A map of DOM element attribute names to the normalized name. This is needed to do reverse lookup from normalized name back to actual name.
On Tue, Nov 4, 2014 at 12:34 PM, Anmol Sharma [email protected] wrote:
what is $attr ??
— Reply to this email directly or view it on GitHub https://github.com/kelp404/angular-validator/issues/36#issuecomment-61657594 .
Actually I am new angularjs . Can any one help to add dynamic error message
I am bit confused $attr