angularjs - Form validation error when using ion-scroll tag -
i'm creating ionic app , i'm having issues form validation when use < ion-scroll> tag. form:
<form ng-show="!success" name="form" role="form" novalidate ng-submit="register()" show-validation> <div class="list list-inset"> <label class="item item-input"> <input type="text" class="form-control" name="firstname" placeholder="nome" ng-model="registeraccount.firstname" ng-minlength=1 ng-maxlength=50 required maxlength="50"> </label> <div ng-show="form.firstname.$dirty && form.firstname.$invalid" class="padding-top padding-left assertive"> <p class="help-block" ng-show="form.firstname.$error.required"> message </p> </div> . . . <label class="item item-input"> <input type="password" class="form-control" name="password" placeholder="senha" ng-model="registeraccount.password" ng-minlength=5 ng-maxlength=50 required> </label> <div ng-show="form.password.$dirty && form.password.$invalid" class="padding-top padding-left assertive"> <p class="help-block" ng-show="form.password.$error.required"> message </p> </div> <label class="item item-input"> <input type="password" class="form-control" name="confirmpassword" placeholder="repita senha" ng-model="confirmpassword" ng-minlength=5 ng-maxlength=50 required> </label> <div ng-show="form.confirmpassword.$dirty && form.confirmpassword.$invalid" class="padding-top padding-left assertive"> <p class="help-block" ng-show="form.confirmpassword.$error.required"> message </p> <p class="help-block" ng-show="form.confirmpassword.$error.minlength"> sua confirmação de senha precisa ter no mínimo 5 caracteres. </p> <p class="help-block" ng-show="form.confirmpassword.$error.maxlength"> sua confirmação de senha deve ser menor que 50 caracteres. </p> </div> </div> <div class="form-button"> <button type="submit" class="button button-block button-balanced">criar conta</button> </small> </div> </form>
this form working correctly when there no ionic's tag, however, when add ion-scroll tag, either inside or outside form tag, validation fails saying password , confirm password different. should use specific ionic tag form? tag should use?
the problem because ionic's components uses child scope, kind of scope "creates 'isolate' scope not prototypically inherit." solved problem using recommended best practice of use "." (dot) in models. changed:
<input type="password" ng-model="confirmpassword" required>
to
<input type="password" ng-model="something.confirmpassword" required>
Comments
Post a Comment