Strange behavior of template parsing depending on attributes order
Hello, I don't know if this is part of the template parser specs, but it seems that attributes order affects parsing. In the The Basics example on the top page, in src/hello_world.html, if one replaces:
<input type="text" [(ngModel)]="yourName" placeholder="Enter a name here">
for
<input placeholder="Enter a name here" [(ngmodel)]="yourName" type="text">
the parser cannot parse the ngModel property
It looks like you need to wrap some code in ```
In your second use case (<input placeholder="Enter a name here" [(ngmodel)]="yourName" type="text">) the ngmodel is lower-cased - I don't know if this is intentional or not, but new HTML parser is case sensitive when it comes to property names.
I don't know if this is your exact problem since you are not giving details on:
the parser cannot parse the ngModel property
What does it mean exactly? Are you getting any error on the console? Bad runtime behavior? Putting together a plunker with a reproduce scenario would give us those details.
sorry for mistyping, does not work with ngModel too. Plunker: http://plnkr.co/edit/6D0bb7CCnGSFDp1Xw5Kh?p=preview
it gives:
EXCEPTION: Template parse errors:
Can't bind to 'ngΜodel' since it isn't a known native property ("data-bind to the input element; store value in yourName -->
<input placeholder="Enter a name here" [ERROR ->][(ngΜodel)]="yourName" type="text">
<hr>
<!-- conditionally display `yourName` -->
"): HelloWorld@2:39
Your "M" character has some funny encoding. Could it be your keyboard layout?
Edit: try re-typing the M using your code editor
@pietie thanks for the reply ( I am a Greek living in Japan, sometimes encodings do get out of hand )
copying/pasting from you did not fix the problem, but I copied from the original plunker, shuffled the attributes and it seems to work fine, so it must not be the attributes order problem, as I initially supposed, sorry about alarming you.
Will keep trying to figure this out, thanks
@pkozlowski-opensource, @pietie thanks for your help, I finally figured it out, the problem was on my side, not of the parser, sorry for this. (basically, the core cause was as @pkozlowski-opensource rightly pointed out that the parser is case-sensitive, while my Html parser/writer turns everything to lowercase. Any way to tackle this?)
I am closing this issue.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.