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

Pass multiple params to iso-method #27

Open
that1guy opened this issue Oct 22, 2014 · 1 comment
Open

Pass multiple params to iso-method #27

that1guy opened this issue Oct 22, 2014 · 1 comment

Comments

@that1guy
Copy link

 $scope.$emit('iso-method', {name:'layout', params:instance.elements[0], function(){
                console.log("done");
            }});

gives me error:

Uncaught SyntaxError: Unexpected token ( search.js:30
Error: [ng:areq] http://errors.angularjs.org/1.2.26/ng/areq?p0=searchController&p1=not%20aNaNunction%2C%20got%20undefined
    at Error (native)
    at http://localhost:8081/angular/angular.min.js:6:450
    at Db (http://localhost:8081/angular/angular.min.js:19:106)
    at Wa (http://localhost:8081/angular/angular.min.js:19:193)
    at http://localhost:8081/angular/angular.min.js:67:403
    at link (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-route.min.js:7:248)
    at N (http://localhost:8081/angular/angular.min.js:54:372)
    at g (http://localhost:8081/angular/angular.min.js:47:256)
    at http://localhost:8081/angular/angular.min.js:46:377
    at http://localhost:8081/angular/angular.min.js:48:217 

If I just don't pass in a callback function I get error:

TypeError: undefined is not a function
    at Object.i.Isotope._masonryLayout (http://localhost:8081/isotope/jquery.isotope.min.js:13:10124)
    at Object.i.Isotope.layout (http://localhost:8081/isotope/jquery.isotope.min.js:13:6548)
    at HTMLDivElement.<anonymous> (http://localhost:8081/isotope/jquery.isotope.min.js:13:15321)
    at Function.n.extend.each (http://localhost:8081/jquery/dist/jquery.min.js:2:2880)
    at n.fn.n.each (http://localhost:8081/jquery/dist/jquery.min.js:2:847)
    at i.fn.isotope (http://localhost:8081/isotope/jquery.isotope.min.js:13:15219)
    at k.$scope.updateMethod (http://localhost:8081/angular-isotope/dist/angular-isotope.js:94:31)
    at methodHandler (http://localhost:8081/angular-isotope/dist/angular-isotope.js:103:21)
    at http://localhost:8081/angular-isotope/dist/angular-isotope.js:122:14
    at k.$emit (http://localhost:8081/angular/angular.min.js:113:471) 

thanks for help.

@jojobyte
Copy link

That initial code has a typo, just fyi.

{
  name: 'layout',  
  params: instance.elements[0], 
  function(){} // this function has no paramater, so it will break the object
}
{
  name: 'layout',  
  params: instance.elements[0], 
  function: function(){} // this would be a proper object
  // using the word function as an attribute is bad form in JS last I checked
}

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

2 participants