Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dragend and Angular js #70

Open
danieletdg opened this issue Jun 26, 2015 · 3 comments
Open

dragend and Angular js #70

danieletdg opened this issue Jun 26, 2015 · 3 comments

Comments

@danieletdg
Copy link

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:

  • the controller is included in the body tag, it's useless to post more code
  • "source" in a Rest uri already tested with curl

Thank you,
Daniele

@danieletdg danieletdg changed the title dragend e Angular js dragend and Angular js Jun 26, 2015
@tuliomarchetto
Copy link

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
Copy link
Author

Sorry Tulio, no pogress here.

@gvieiradot
Copy link

Same problem :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants