찾다

 >  Q&A  >  본문

angular.js - angularjs 如何向coffeescript传值

前台这样的: <li ng-click="$scope.getCoachsByExperience(1,3)">1-3年</li>
后台: $scope.getCoachsByExperience=(a,b)->

    value=[]
    for coach in coachs
      if coach.Experience >a and coach.Experience<=b
        value.push coach
    $scope.coachs=value
    $scope.totalCount=data.TotalCount

$scope.getCoachsByExperience(a,b)

报错:ReferenceError: a is not defined

然后现在报错是找不到:a,b

我的想法是点击1-3年就可以列出列表了

怎么把 <li ng-click="$scope.getCoachsByExperience(1,3)">1-3年</li> 当中的ng-click="$scope.getCoachsByExperience(1,3)" 1,3 传到 后台a,b 现在取不到a,b的值搞不来 ,哪里想错了,调试都跳不进去,求大神点拨

習慣沉默習慣沉默2744일 전702

모든 응답(1)나는 대답할 것이다

  • ringa_lee

    ringa_lee2017-05-15 16:58:26

    ? ? ? ? ? ? ? ? ? ? 제발 하느님

    회신하다
    0
  • 취소회신하다