Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Attribute Parser Error #183

Closed
MohammadYounes opened this issue Oct 8, 2014 · 3 comments
Closed

Attribute Parser Error #183

MohammadYounes opened this issue Oct 8, 2014 · 3 comments
Assignees
Milestone

Comments

@MohammadYounes
Copy link

I'm developing an Angular app and using Razor as my view engine, I had a case where I needed to use ng-pattern attribute.

Example:

<input type="text" ng-pattern="/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@@[a-z0-9]([a-z0-9-]*[a-z0-9])?\.([a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i" />

Although I'm escaping @, the above gives the following error:

Parser Error Message: "[" is not valid at the start of a code block.  Only identifiers, keywords, comments, "(" and "{" are valid.

I was able to work around this using data-ng-pattern, but shouldn't this be allowed by Razor ?

@danroth27 danroth27 changed the title Parser Error Attribute Parser Error Oct 17, 2014
@danroth27 danroth27 added this to the 4.0.0-rc1 milestone Oct 17, 2014
@yishaigalatzer
Copy link
Contributor

Thanks for reporting this, we are going to investigate.

@yishaigalatzer
Copy link
Contributor

You can escape this way

    <input type="text" ng-pattern="/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@("@")[a-z0-9]([a-z0-9-]*[a-z0-9])?\.([a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i" />

But yes we are going to try and fix it.

@yishaigalatzer yishaigalatzer modified the milestones: 4.0.0-rc1, 4.0.0-beta3 Jan 15, 2015
@danroth27 danroth27 modified the milestones: 4.0.0-rc1, 4.0.0 Mar 16, 2015
@Eilon
Copy link
Member

Eilon commented Apr 24, 2015

@ajaybhargavb good luck 😄 Please chat with @NTaylorMullen for context.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants