Skip to content

Instantly share code, notes, and snippets.

@timothyklim
Created November 24, 2012 10:32
Show Gist options
  • Save timothyklim/4139122 to your computer and use it in GitHub Desktop.
Save timothyklim/4139122 to your computer and use it in GitHub Desktop.
tr ng-repeat="chunksetsBuf in splitChunksetsArray[for_id]"
td.group ng-repeat="(index, col) in chunksetsBuf"
$scope.chunksets = Chunksets.get {}
$scope.splitChunksetsArray = {}
$scope.splitChunksets = ->
index = 0
$scope.splitChunksetsArray = {}
buf = []
_.each $scope.chunksets, (chunksets, kind) ->
$scope.splitChunksetsArray[kind] = []
_.each chunksets, (set) ->
index += 1
buf.push set
if index == 4
$scope.splitChunksetsArray[kind].push buf
index = 0
buf = []
$scope.splitChunksetsArray[kind].push buf unless _.isEmpty(buf)
$scope.splitChunksets()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment