GithubHelp home page GithubHelp logo

nandakumar-r / ng2-social-share Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epotignano/ng2-social-share

0.0 1.0 0.0 23 KB

Angular2 social share module, share urls and content on social networks such as facebook, google+, twitter, pinterest and so on -

JavaScript 38.31% TypeScript 61.69%

ng2-social-share's Introduction

Usage

npm install --save ng2-social-share

Made this, you should include the directive where you want to use it as any other Angular2 directive.

import { Component, OnInit } from '@angular/core';
import { CeiboShare } from 'ng2-social-share';

@Component({
    selector: 'app-my-fancy-component',
    templateUrl: 'my-fancy-component.component.html',
    directives:[CeiboShare]

})
export class myFancyComponent implements OnInit {
//vars used only for example, put anything you want :)
public repoUrl = 'https://github.com/Epotignano/ng2-social-share';
public imageUrl = 'https://avatars2.githubusercontent.com/u/10674541?v=3&s=200';

constructor() { }

ngOnInit() {
//do something OnInit

}

}

Accepted params

export declare class FacebookParams {
    u: string;
}

export class GooglePlusParams {
    url: string
}

export class LinkedinParams {
    url:string
}

export declare class PinterestParams {
    url: string;
    media: string;
    description: string;
}

export class TwitterParams {
    text: string;
    url: string;
    hashtags: string;
    via: string;
}

In your component html file

<!--- For this example I am using button, but you can attach the directive to anything you want
   and it will display the popup for share! :D
-->
   <button ceiboShare  [facebook]="{u: repoUrl}">Facebook</button>
   <button ceiboShare  [linkedIn]="{url:repoUrl}">Linkedin</button>
   <button ceiboShare  [googlePlus]="{url:repoUrl}">Google Plus</button>
   <button ceiboShare  [twitter]="{url:repoUrl, text:'Checkout this awesome ng2 social share directive', hashtags:'angular2, social, ceiboIT'}">Twitter</button>
   <button ceiboShare [pinterest]="{url:repoUrl, media: imageUrl, description:'Checkout this awesome angular2 directive'}">Pinterest</button>


ROADMAP

Support for:
Email
Whatsapp
Telegram
Viber
Line
Tumblr
Hackernews
VK
XING
Buffer
Instapaper
Pocket
Digg
Stumble Upon
Flipboard
Weibo
Renren
My Space
Blogger
Baidu
Douban
Okru

ng2-social-share's People

Contributors

codealchemist avatar diegourrutiag avatar samuelsilvadev avatar

Watchers

 avatar

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.