1

I have a problem with AngularJS.

I have a working sample as this :

http://jsfiddle.net/IgorMinar/Hxbqd/5/

And I would like to modify it to directly call at my connectControl function as this:

http://jsfiddle.net/Hxbqd/68/

The only slight change between them is:

$scope.registerWithFacebook();

Why is not this one working? Or What I have to do make it work?

Thanks

3
  • what do you mean by it is not working Commented Apr 2, 2013 at 6:46
  • That might be a problem with the service, that calls the $apply function while you are already in a digest cycle. I am not an expert, but had a similar problem when calling $apply in response to something different than a DOM event. Commented Apr 2, 2013 at 6:48
  • do you have any error in the console Commented Apr 2, 2013 at 6:51

1 Answer 1

1

As Arun P Johny suggested there was error in my console.

The problem is that FB was not ready at changed statement. When I replaced it something like this

setTimeout(function(){$scope.registerWithFacebook()},3000);

It started to work.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.