Giter VIP home page Giter VIP logo

angular2-facebook's Introduction

angular2-facebook

##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.

##Pre-requisites:

  1. 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">
  1. For facebook, I have used facebook javascript SDK. just add the following line in your index.html
<script src="//connect.facebook.net/en_US/sdk.js"></script>

##Steps for integration:

  1. Copy the 'facebooklogin.component.ts' file in your components directory of your project.
  2. 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
  3. copy <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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.