Closed obrador closed 1 year ago
Same here, or there's lack of documentation or there's another issue..
SocialLoginModule also has to be added to the imports of the module that declares the component in whose .html file you want to use asl-google-signin-button.
But then you get an error that this module has been already loaded.
is there any solution to this? the directive issue is the only thing (for now) stopping me to implement the library...
Hey there!
I found the solution to this problem (according to the configuration I have inside my project).
According to the documentation, you have to add the following line but it doesn't say where:
<asl-google-signin-button></asl-google-signin-button>
According to the documentation, you must import "SocialLoginModule" from the app.module, but this if you are working on this same component (which means you must import it in app.module if you are going to work on app.component.html file)
So you must bring it from the file.module where you will work your html.
Example:
My folder structure:
-app (folder) |--modules (folder) |----auth (folder) |------pages (folder) |--------register (folder) |----------register.component.ts |----------register.component.html |----auth.module.ts |--app.module.ts
As you can see, I have a different configuration adding an auth.module.ts in addition to the app.module that is already "default" in angular.
So as I will implement the google button in my register.component.ts and in my register.component.html, I must import "SocialLoginModule" inside auth.module.ts, which encapsulates those parts of my project.
Likewise remove it from app.module.ts. All the configuration you did in the app.module about "SocialAuthServiceConfig" like providers and other things, must go to the one that will encapsulate your component.
This way you should not have any more problems.
(I clarify again that this was my solution to the configuration that I have of my project)
If you have something similar, try importing this part of the library from the part that encapsulates the component you will be working with
I hope I can help you with your problem and you can continue doing what we love the most!
Thanks a lot! this worked for me.
As on the version @abacritt/angularx-social-login:2.2.0
Add import:
import { SocialLoginModule, GoogleSigninButtonModule } from '@abacritt/angularx-social-login';
into the module where your login component is placed (Not always in AppModule, check based on your project stucture)
Hi, When I try to use asl-google-signin-button in my html template I get this error when building application:
I'm sure I miss something, but I set up my code just as README.
This is how my app.module.ts looks like:
And my component just like the README:
I'm sure I miss something, but I can't see documented in the README Thanks in advance