angularjs – 角度函数错误:[$parse:syntax]

前端之家收集整理的这篇文章主要介绍了angularjs – 角度函数错误:[$parse:syntax]前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
错误消息是
  1. 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)
  2. at Error (native)
  3. at http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:6:457
  4. at bb.throwError (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:169:490)
  5. at bb.consume (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:170:424)
  6. at bb.object (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:177:474)
  7. at bb.primary (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:169:121)
  8. at bb.unary (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:175:273)
  9. at bb.multiplicative (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:175:6)
  10. at bb.additive (http://127.0.1.1/AnjularJS/ng-Films/Scripts/Vendor/angular.min.js:174:399)
  11. 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">

使用代码

  1. <tbody ng-repeat="list in lists">
  2. <tr>
  3. <td>
  4. <button ng-click="Fedit({{list.type}},{{list.id}})" class="btn btn-primary">Edit</button>
  5. </td>
  6. <td>
  7. <button ng-click="Fdelete({{list.type}},{{list.id}})" class="btn btn-primary">Delete</button>
  8. </td>
  9. </tr>
  10. </tbody>

函数实际上采用列表数组中的两个Arguments.但我不知道该怎么办.

试试这个:
  1. <tbody ng-repeat="list in lists">
  2. <tr>
  3. <td>
  4. <button ng-click="Fedit(list.type,list.id)" class="btn btn-primary">Edit</button>
  5. </td>
  6. <td>
  7. <button ng-click="Fdelete(list.type,list.id)" class="btn btn-primary">Delete</button>
  8. </td>
  9. </tr>
  10. </tbody>

希望能帮助到你…..!

猜你在找的Angularjs相关文章