https://github.com/sabbirrahman/ng-socializer
ng-socializer - A Collection of Angular Services for Social Network Integration
https://github.com/sabbirrahman/ng-socializer
angular service social social-network
Last synced: about 2 months ago
JSON representation
ng-socializer - A Collection of Angular Services for Social Network Integration
- Host: GitHub
- URL: https://github.com/sabbirrahman/ng-socializer
- Owner: sabbirrahman
- Created: 2018-02-21T11:36:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T18:48:16.000Z (over 8 years ago)
- Last Synced: 2025-11-28T06:22:57.262Z (7 months ago)
- Topics: angular, service, social, social-network
- Language: TypeScript
- Homepage: https://sabbirrahman.github.io/ng-socializer/
- Size: 219 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ng-socializer [](https://twitter.com/intent/tweet?text=A%20Collection%20of%20Angular%20Services%20for%20Social%20Integration&url=https://github.com/sabbirrahman/ng-socializer&via=sabbirrahmanme&hashtags=angular,ng,socializer)
>A Collection of Angular Services for Social Integration.
[](https://github.com/sabbirrahman/ng-socializer/blob/master/LICENSE)
[](https://www.npmjs.com/package/ng-socializer)
Do you find integrating social network into your angular application harder? Fear no more, ng-socializer lets you integrate social networks such as facebook, google, instagram pinterest and linkedin easily.
## Features
* Supports facebook, google, instagram, pinterest and linkedin.
* Easy and common API for all supported social networks.
* Common data structure for user profile reponse.
* RxJS observable based.
* Strongly typed API.
## Installation
`npm install --save ng-socializer`
## How To
1. Import SocializerModule into Your App/Root Module
```typescript
import { SocializerModule } from 'ng-socializer';
@NgModule({
...
imports: [
SocializerModule.forRoot()
]
...
})
export class AppModule { }
```
2. Import and initialize the social sdk that you need from any component
```typescript
import { FacebookSocializer } from 'ng-socializer';
export class MySocialComponent implements OnInit {
constructor(private facebookSocializer: FacebookSocializer) {}
ngOnInit() {
this.facebookSocializer.init({ appId: appId }).subscribe();
}
}
```
3. Use the service to connect and get user's profile informations
```typescript
import { FacebookSocializer, SocialProfile } from 'ng-socializer';
export class MySocialComponent implements OnInit {
...
ngOnInit() {
...
// Everytime User Connects or Disconnects, A Value will be Emmited from profile$ Observable
this.facebookSocializer.profile$.subscribe((profile) => {
console.log(profile);
});
}
// Call This Method from View on Click Event
connectWithFacebook() {
this.facebookSocializer.connect().subscribe();
}
// Don't Forget to Unsubscribe
ngOnInit() {
if (this.facebookSocializer.profile$) {
this.facebookSocializer.profile$.unsubscribe();
}
}
...
}
```
## Documentation
Coming Soon...
Enjoy 😃