1

I'm developing a project in angular 1.2, I have a problem with utf-8 encoding and the angular binding, some chars like "ñ" throw an error:

HTML

<select class="form-control " ng-model="IdDesempeño">

Angular error

Lexer Error: Unexpected next character

I've got a plunker demo

Do you have any idea what's going on?

The angular error doc

2 Answers 2

5

You could wider the range of characters allowed in AngularJs identifiers to match your requirements. This is done by modifying the isIdent function in angular.js file, around line 9730. I did this to allow French special characters and some more.

isIdent: function(ch) {
    return ('a' <= ch && ch <= 'z' ||
            'A' <= ch && ch <= 'Z' ||
            '_' === ch || ch === '$') || 
            129 <= ch.charCodeAt(0) && ch.charCodeAt(0) <= 496; // added this line

There is an old pull request on Github for this (https://github.com/angular/angular.js/pull/4747).

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

Comments

-1

Variables can't contain "ñ".

The JSON model was misspelled.

Remember to put the script in the and your page will be a little faster.

Look better in the syntax AngularJS.

I learning AngularJS too

you did fork on Plunker, see it.

SUERTE!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.