Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
485 stars 114 forks source link

dragend and Angular js #70

Open danieletdg opened 9 years ago

danieletdg commented 9 years ago

Hi Guys, i 'd like to use this plugin and integrate it with my Angular js app. But i've some issue with the ng-repeat. Anyone has used dragend with angular? This is my simple code. I've create a custom directive like this:

Custom directive

(function(){
  var app = angular.module('Pizzapp', ["ngMaterial"]);

  app.controller('homeCtrl', ['$http' , '$scope', function($http, $scope){

    $scope.pizze = [];
    $http.get('source').success(function(data) { 
        $scope.pizze = data;    
    });     
  }]);

  app.directive('myProduct', function($timeout) {
    return {
        restrict: 'A',
        scope: { pizze: '=' },
        link: function(scope, element, attrs) {
            scope.$watch("my-product", function (newValue, oldValue) {
                $timeout(function() {
                    $('#demo').dragend();
                });
            });
        }
    };
  });
})();

then the html code

         <div id="demo" my-product>
          <div class="dragend-page" style="background:red; height:600px;"></div>
          <div class="dragend-page" style="background:purple; height:600px;">
             <div class="col s12 m6 l4" ng-repeat="pizza in pizze">
                 <div class="card-panel">
                     <span class="balck-text">{{pizza.nome}}</span>             
                 </div>
            </div> 
          </div>
      </div>

info:

Thank you, Daniele

tuliomarchetto commented 8 years ago

Hi Daniele,

Did you get any progress with this issue? I'm facing the same problem here, maybe you could help me out...

Cheers!

danieletdg commented 8 years ago

Sorry Tulio, no pogress here.

gvieiradot commented 7 years ago

Same problem :(