##Learn how to integrate Facebook login in angular2 framework. As there is no good angular2 component available for same, I struggled a bit searching on internet and tried to figrued out how to do it with angular 2. in the last, after spending more than 10 hours, I figured out by modifying the current integration code and making it suitable for integration with angular 2. Looking back, it is very easy and straight forward. but I am adding the componentized code here so that no one else loses a night on the same problem.
- I have used bootstrap css and bootstrap-social css library for the HTML button. include the following lines in your index.html code
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/4.12.0/bootstrap-social.min.css" rel="stylesheet"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
##Steps for integration:
- Copy the 'facebooklogin.component.ts' file in your components directory of your project.
- Copy the 'facebooklogin.html' in the place where you keep htmls. In case, you are not using templateUrl but using template in your component , then copy the HTML code in template
<facebook-login></facebook-login>HTML tag in the place you want to show the facebook login button.
It should work as it is. If you face errors, let me know or fork it and improve it. I have created this only for my project use, but will be happy to fix any issue if i find time.