vamsikrishnamannem
vamsikrishnamannem

Reputation: 4847

angular function Error: [$parse:syntax]

Error Message is

Error: [$parse:syntax] http://errors.angularjs.org/1.3.0-beta.13/$parse/syntax?p0=list.type&p1=is%20unexpected%2C%20expecting%20%5B%3A%5D&p2=9&p3=Fedit(%7B%7Blist.type%7D%7D%2C%7B%7Blist.id%7D%7D)&p4=list.type%7D%7D%2C%7B%7Blist.id%7D%7D)
    at Error (native)
    at http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:6:457
    at bb.throwError (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:169:490)
    at bb.consume (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:170:424)
    at bb.object (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:177:474)
    at bb.primary (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:169:121)
    at bb.unary (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:175:273)
    at bb.multiplicative (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:175:6)
    at bb.additive (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:174:399)
    at bb.relational (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:174:263) <button ng-click="Fedit({{list.type}},{{list.id}})" class="btn btn-primary"> 

using the code is

<tbody ng-repeat="list in lists">
  <tr>
    <td>
    <button ng-click="Fedit({{list.type}},{{list.id}})" class="btn btn-primary">Edit</button>
    </td>
    <td>
      <button ng-click="Fdelete({{list.type}},{{list.id}})" class="btn btn-primary">Delete</button>
    </td>
  </tr>
</tbody>

The function actually take the two Arguments in list array. but I do not know what to do.

Upvotes: 8

Views: 26045

Answers (5)

Muhammad Awais
Muhammad Awais

Reputation: 4502

In my case it was an extra space in angular expressions:

{{Student.Enrollment Date}}

The right one:

{{Student.EnrollmentDate}}

Upvotes: 0

anayarojo
anayarojo

Reputation: 1205

Check this link $parse:syntax

In my case this error is showing when I use , on angular expressions

Regards

Upvotes: 1

Lean Vasconcellos
Lean Vasconcellos

Reputation: 11

This worked for me. I only took out the brackets.

Like this: Fedit({{list.type}},{{list.id}}) --> Fedit(list.type,list.id)

Tanks.

Upvotes: 1

Venkatesh Laguduva
Venkatesh Laguduva

Reputation: 14408

ng-repeat has it's own scope and attribute binding as you have given does not work -{{list.type}} needs to be just list.type and {{list.id}} becomes list.id.

see this

Upvotes: 0

Alagarasan M
Alagarasan M

Reputation: 907

Try this:

<tbody ng-repeat="list in lists">
 <tr>
  <td>                          
   <button ng-click="Fedit(list.type,list.id)" class="btn btn-primary">Edit</button>
  </td>
  <td>
   <button ng-click="Fdelete(list.type,list.id)" class="btn btn-primary">Delete</button>
  </td>
 </tr>
</tbody>

Hope it helps.....!

Upvotes: 13

Related Questions