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

time to refactoring ? #70

Closed
adyba opened this issue Sep 1, 2014 · 3 comments
Closed

time to refactoring ? #70

adyba opened this issue Sep 1, 2014 · 3 comments

Comments

@adyba
Copy link

adyba commented Sep 1, 2014

I know it is a development version and I know Angular doesn't have strict rules what pattern should do what, but there are some issues that should be addressed. I believe the huge Facebook provider should be split into infrastructure settings (provider) and the communication part (client <=> FB SDK/API) should be (any kind of) service.
Such service could be consumed by controllers and directives. For security and other reasons there should be a 'fb-logged' html attribute instead of $scope.logged variable inside the controller or several controllers. Such attribute and other HTML suggars would help integrate the code with other auth providers across the whole app (account&permission management, navbar, views, etc.)

@mrzmyr
Copy link
Collaborator

mrzmyr commented Sep 1, 2014

@adyba this module has already a provider (FacebookProvider) and a service (Facebook) and it can be consumed by a controller as you can see in the usage section:

.controller('authenticationCtrl', function($scope, Facebook) {

or with a directive

.directive('customDirective', function(Facebook) {

When you need a fb-logged html attribute you can write a custom directive and use the Facebook service with it like in the example above.

@mrzmyr
Copy link
Collaborator

mrzmyr commented Sep 2, 2014

If you still have ideas, please open a new issue. When i got you wrong, please comment. For now I will close the issue.

@mrzmyr mrzmyr closed this as completed Sep 2, 2014
@adyba
Copy link
Author

adyba commented Sep 19, 2014

Satellizer does it exactly the way Auth should work.

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