SHARE
TWEET

Untitled

a guest Oct 15th, 2016 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. var app = angular.module('angular-dragula-example', [angularDragula(angular)]);
  4.  
  5. app.controller('NestedRepeatCtrl', ['$scope',
  6.   function ($scope) {
  7.  
  8.  
  9.  
  10.     $scope.groups = [
  11.       {
  12.         name: 'Group A',
  13.         items: [{name: 'Item A'},{name: 'Item B'},{name: 'Item C'},{name: 'Item D'}]
  14.       },
  15.       {
  16.         name: 'Group B',
  17.         items: [{name: 'Item 1'},{name: 'Item 2'},{name: 'Item 3'},{name: 'Item 4'}]
  18.       }
  19.     ];
  20.  
  21.     $scope.$on('nested-bag.drop', function(e, el, container, source) {
  22.       console.log(container.scope());
  23.     });
  24.   }
  25. ])
  26.  
  27. /* Need to push items to $scope.groups[0] and $scope.groups[1] */
  28. container.group[0].items.push({
  29.   name: 'Pushed item'
  30. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top