如何通过按Enter键在ng-repeat中调用函数

时间:2019-04-01 09:38:15

标签: javascript angularjs

我想在输入按键时调用selectedDay()函数。

<div class="week" ng-repeat="week in weeks" 
                  arrow-selector='{"row":{{weeks.length}}, "col":7}'>
  <span class="day fontSize" >{{week.name}}</span>
  <span class="day" data-toggle="modal" data-target="#flipFlop"  
        ng-class="{'selectedBox':$index == selectedCol && $parent.$index ==  selectedRow }" 
        ng-click="selectedDay(day,week.name)"
        ng-repeat="day in week.days"
        style="overflow:auto; line-height:15px !important;" focus-me="true" id="selectedDay"> 
    
    <span>{{day.number}}</span>
    <span class="chip" ng-repeat="ct in day.timeLog" ng-if="day.timeLog.length">{{ ct.Shift }} : {{ ct.Hours }}hr</span>
  </span>
</div>

0 个答案:

没有答案