用ng-click Angularjs调用多个方法
Calling multiple methods with ng-click Angularjs
在ng-click控件中调用两个方法的语法是怎样的呢?
HTMLng-click="submitForm(M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15), postComments(comment)">
我试过用逗号,也试过不用。
误差Error: [$parse:syntax] Syntax Error: Token ',' is an unexpected token at column 77 of the expression [submitForm(M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15), postComments(comment)] starting at [, postComments(comment)].
http://errors.angularjs.org/1.4.3/$parse/syntax?p0=%2C&p1=is%20an%20unexpected%20token&p2=77&p3=submitForm(M1%2C%20M2%2C%20M3%2C%20M4%2C%20M5%2C%20M6%2C%20M7%2C%20M8%2C%20M9%2C%20M10%2C%20M11%2C%20M12%2C%20M13%2C%20M14%2C%20M15)%2C%20postComments(comment)&p4=%2C%20postComments(comment)
at REGEX_STRING_REGEXP (http://localhost:8100/lib/ionic/js/ionic.bundle.js:8895:12)
at Object.AST.throwError (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21708:11)
at Object.AST.ast (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21478:12)
at Object.ASTCompiler.compile (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21927:31)
at Parser.parse (http://localhost:8100/lib/ionic/js/ionic.bundle.js:22776:29)
at $parse (http://localhost:8100/lib/ionic/js/ionic.bundle.js:22900:39)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:57510:7
at IonicModule.config.factory.directive.directive.restrict (http://localhost:8100/lib/ionic/js/ionic.bundle.js:57526:5)
at invokeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:17477:9)
at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:16977:11) <ion-item class="item-balanced item item-complex" href="#/app/checklist" value="submit" ng-click="submitForm(M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15), postComments(comment)">
您需要在函数调用之间放置;
(分号),而不是,
(逗号)
ng-click="submitForm(M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15); postComments(comment)">
相关文章:
- 如何在webView,Android中从@JavascriptInterface方法调用Javascript
- javascript从子方法调用父方法
- 我应该返回一个类似console.log()的方法调用吗
- NodeJS-从同一文件中的另一个方法调用一个方法
- 使用restangular save方法调用put与post时的控件
- 从实例方法调用实例方法
- Node.js-异步方法调用问题
- Jquery事件绑定获胜'当作为方法调用时不起作用,但当直接在控制台中调用时会起作用
- 向模板实例变量传递调用方法调用的结果时出现异常
- jQuery 方法调用了两次
- 不能从 Backbone.View 的方法调用 Backbone.collection 的方法,其中包含 require
- 组合 onLayout 的方法调用
- lodash/下划线 - 使用绑定与方法调用和方法保持未绑定
- 从公共方法调用模块的私有函数
- 如何对 jqGrid 的 loadComplete 和 onSelectRow 进行基因预和后方法调用
- 完全限定的 JavaScript 方法调用
- 为什么我在 Angular JS 中收到两个方法调用
- 如何在从排序方法调用参数时将其传递给回调
- 使用两种不同的方法调用方法
- 如何在 javascript 中更改方法调用的全局范围