0

Getting error while doing

Note : I cant change the name it should start with 00 due third party dependency. How can I avoid error ?

  <input id="name" data-ng-model="contactInfo.name" name="00xyz"
        type="text" placeholder="" class="form-control" required>
  <p ng-if="(form.00xyz.processed || form.00xyz.$dirty) && form.00xyz.$error.required">name is required</p>

Getting following error:

https://docs.angularjs.org/error/$parse/syntax?p0=.00&p1=is%20unexpected,%20expecting%20%5B)%5D&p2=13&p3=(contactForm.00xyz.processed%20%7C%7C

Error:

Syntax Error: Token '.00' is unexpected, expecting [)] at column 13 of the expression [(contactForm.00xyz.processed ||] starting at [{4}].
1
  • Are you sending these to a webservice? Commented Apr 4, 2016 at 18:37

1 Answer 1

1

I think the problem is with the name of the input as it is starting with a number.

Either change the name to someting like xyz00

Or access the form element's attributes like

ng-if="(form['00xyz'].processed || form['00xyz'].$dirty) && form['00xyz'].$error.required)"

Sign up to request clarification or add additional context in comments.

1 Comment

Correct, Just now figured it out... Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.