使用AngularJS,我迭代一个JSON对象,该对象包含一个事件对象数组,包含一个竞争对象数组.
我希望将每个显示event在一个表中,然后每个表示competition一个td,但每行只有三个单元格
我正在使用ng-repeat来返回每个事件的表格列表,但是我很难将比赛分成<tr>每三个一个新的比赛<td>.
除了从JSON重建我自己的大型对象之外,在Angular中执行我所描述的最好的方法是什么?
目前来看:
<table ng-repeat="listing in listings">
<tr>
<th colspan="3">{{listing.name}}</th>
</tr>
<tr>
<td ng-repeat="competition in listing.competitions">
{{competition.id}} - {{competition.name}}
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
期望的输出:
<table>
<tr>
<th colspan="3">Event Name</th>
</tr>
<tr>
<td>competition id - competition name</td>
<td>competition id - competition name</td>
<td>competition id - competition name</td>
</tr>
<tr>
<td>competition id - competition name</td>
<td>competition id - competition name</td>
<td>competition id - competition name</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
控制器:
app.controller('EventsCtrl', function ($scope, …Run Code Online (Sandbox Code Playgroud) 我在 Gitlab 中有一个场景,当第一次在 Gitlab 中打开 MR 时,我想 ping 特定的 Slack 通道。我尝试rules在源为时触发merge_request_event,但不幸的是,当新提交推送到打开的 MR 时,这也会触发我的工作。
是否可以在 MR 最初打开时运行一次Gitlab CI 作业,并且在此之后不再运行,即使将新提交添加到 MR 中也是如此?
ping:
stage: .pre
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
script:
- 'curl to slack url'
Run Code Online (Sandbox Code Playgroud) continuous-integration continuous-delivery gitlab gitlab-ci gitlab-ci-runner