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

Error on link function angularjs 1.3.13 #27

Open
mastermind1981 opened this issue Apr 5, 2015 · 2 comments
Open

Error on link function angularjs 1.3.13 #27

mastermind1981 opened this issue Apr 5, 2015 · 2 comments

Comments

@mastermind1981
Copy link

Hi,

I got an error on link function of all directive : actually, the controller ctrl is passed but it does not reference the controller "controller" it's an empty shell. So when ctrl.init() is called in the link function i got on all link functions:

TypeError: undefined is not a function
at link (http://localhost:3000/bower_components/angular-social/angular-social.src.js:341:18)
Thanks in advance

@mastermind1981 mastermind1981 changed the title err Error on link function angularjs 1.3.13 Apr 5, 2015
@CWSpear
Copy link

CWSpear commented Apr 6, 2015

I'm seeing this issue, too. I'm using Angular 1.3.15.

@philiph
Copy link

philiph commented Apr 12, 2015

Same for me, AngularJS 1.3.15

The issue seems to be that in the various scripts such as 02-facebook.js, 03-twitter.js, on the last line of the link function, it tries to call the ctrl.init function which is undefined.

For example in 02-facebook.js:

link: function(scope, element, attrs, ctrl) {
    element.addClass('ng-social-facebook');
    if (!ctrl) {
        return;
    }
    scope.options = options;
    scope.ctrl = ctrl;
    ctrl.init(scope, element, options);
}

It seems the controller passed in is not yet fully initialised when the link is called.

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