New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ngx-linkedin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-linkedin

Linkedin authentication for angular 6 / 7

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

Angular 6 / 7 LinkedIn authorization

This project was generated with Angular CLI version 7.0.5.

Getting started

Install via npm

npm install --save ngx-linkedin

Import the module

In your AppModule, import the SocialLoginModule

import { NgModule } from '@angular/core';
import { NgxLinkedinModule } from 'ngx-linkedin';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';

@NgModule({
    declarations: [AppComponent],
    imports: [
        BrowserModule,
        NgxLinkedinModule.forRoot({
            clientId: ':clientId:'
        })
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {}

Sign in and out users

import { Component } from '@angular/core';
import { NgxLinkedinService } from 'ngx-linkedin';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    constructor(private ngxLinkedinService: NgxLinkedinService) {}

    login() {
        this.ngxLinkedinService.signIn().subscribe(user => {
            console.info('signIn', user);
        });
    }
}

Subscribe to the authentication state

import { Component } from '@angular/core';
import { NgxLinkedinService } from 'ngx-linkedin';

@Component({
    selector: 'app-root',
    template: `
    isAuthorized: {{isAuthorized$ | async}}
    `,
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    public isAuthorized$ = this.ngxLinkedinService.isAuthorized();

    constructor(private ngxLinkedinService: NgxLinkedinService) {}
}

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

FAQs

Package last updated on 26 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts