0
我想加快我的ng-repeat
與limitTo:totalDisplayed
,但是,由於我的語法,我得到一個錯誤。有人能幫我糾正嗎?使用過濾器和limitTo修復ng-repeat語法
ng-repeat="practice in vm.practices | filter: { orgName: vm.searchTerm } limitTo:totalDisplayed track by practice._id"
---編輯--- 以下是錯誤
Error: [$parse:syntax] Syntax Error: Token 'limitTo' is an unexpected token at column 51 of the expression [vm.practices | filter: { orgName: vm.searchTerm } limitTo:totalDisplayed] starting at [limitTo:totalDisplayed].
http://errors.angularjs.org/1.5.7/$parse/syntax?p0=limitTo&p1=is%20an%20unexpected%20token&p2=51&p3=vm.practices%20%7CNaNilter%3A%20%7B%orgName%3A%20vm.searchTerm%20%7D%20limitTo%3AtotalDisplayed&p4=limitTo%3AtotalDisplayed
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:68:12
at AST.throwError (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:14343:11)
at AST.ast (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:14096:12)
at ASTCompiler.compile (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:14559:31)
at Parser.parse (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:15488:29)
at $parse (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:15653:39)
at ChildScope.$watchCollection (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:17056:30)
at Object.ngRepeatLink (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:29503:16)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:1240:18
at invokeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:9814:9)
at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:9215:11)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8510:13)
at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:9210:24)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8510:13)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8513:13)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8513:13)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8513:13)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8513:13)
at publicLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8390:30)
at Object.<anonymous> (https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js:7:24081)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:1240:18
at invokeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:9814:9)
at nodeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:9215:11)
at compositeLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8510:13)
at publicLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8390:30)
at lazyCompilation (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:8728:25)
at l (https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js:7:23072)
at https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js:7:23492
at Scope.$broadcast (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:17767:28)
at https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js:7:18795
at processQueue (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:16170:28)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:16186:27
at Scope.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:17444:28)
at Scope.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:17257:31)
at Scope.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:17552:24)
at done (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:11697:47)
at completeRequest (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:11903:7)
at XMLHttpRequest.requestLoaded (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js:11836:9)
(anonymous) @ angular.js:13708
(anonymous) @ angular.js:10347
invokeLinkFn @ angular.js:9816
nodeLinkFn @ angular.js:9215
compositeLinkFn @ angular.js:8510
nodeLinkFn @ angular.js:9210
compositeLinkFn @ angular.js:8510
compositeLinkFn @ angular.js:8513
compositeLinkFn @ angular.js:8513
compositeLinkFn @ angular.js:8513
compositeLinkFn @ angular.js:8513
publicLinkFn @ angular.js:8390
(anonymous) @ angular-ui-router.min.js:7
(anonymous) @ angular.js:1240
invokeLinkFn @ angular.js:9814
nodeLinkFn @ angular.js:9215
compositeLinkFn @ angular.js:8510
publicLinkFn @ angular.js:8390
lazyCompilation @ angular.js:8728
l @ angular-ui-router.min.js:7
(anonymous) @ angular-ui-router.min.js:7
$broadcast @ angular.js:17767
(anonymous) @ angular-ui-router.min.js:7
processQueue @ angular.js:16170
(anonymous) @ angular.js:16186
$eval @ angular.js:17444
$digest @ angular.js:17257
$apply @ angular.js:17552
done @ angular.js:11697
completeRequest @ angular.js:11903
requestLoaded @ angular.js:11836
失蹤後缺少管limitTo前面的管道符號? - > ng-repeat =「在vm.practices中練習|過濾器:{orgName:vm.searchTerm} | limitTo:total由practice.is顯示的軌跡」 – Setily
那就是答案! – IWI