@asifisthiaq/ng-ion-tweeter
v0.1.0
Published
post-tweet component
Downloads
25
Readme
NgIonTweeter
post-tweet component
tweet-card component
Installation
npm i @asifisthiaq/ng-ion-tweeter --save
Usage
Import ng-ion-tweeter module in app.module.ts or any other desired module.
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { IonicModule } from "@ionic/angular";
import { NgIonTweeterModule } from "@asifisthiaq/ng-ion-tweeter";
@NgModule({
imports: [ CommonModule, IonicModule, NgIonTweeterModule ]
})
Then, use in desired component.
// app.component.ts
import { Component } from "@angular/core";
import { Tweet } from "@asifisthiaq/ng-ion-tweeter";
@Component({
selector: 'my-app',
template: `
<post-tweet
[userProfileImage]="userProfileImg"
(emitOutput)="submitTweetLib($event)"
></post-tweet>
<tweet-card
[tweets]="tweets"
(emitOutput)="deleteTweetLib($event)"
></tweet-card>`,
})
export class MyApp {
tweets: Tweet[] = [
{
"id": 1,
"user_name": "Incredible Concrete Fish Aisf Library",
"tweet_body": "Nam iure repudiandae enim quia ab ut reiciendis veniam qui. Fugiat id dolorem corporis occaecati at inventore dicta cupiditate.",
"user_image_url": "http://placeimg.com/640/480/business"
},
{
"id": 2,
"user_name": "Tasty Metal Salad Library",
"tweet_body": "Nulla recusandae sint sed libero odit. Ut est rem iste. Consequatur voluptatem nesciunt hic autem doloribus quis. Tenetur omnis rerum quia. Non voluptatem perferendis accusamus rerum deserunt dolorem id quis.",
"user_image_url": "http://placeimg.com/640/480/business",
"tweet_image_url": "https://source.unsplash.com/1600x900/?product"
}
];
userProfileImg = "user-profile-image-link";
constructor() {}
submitTweetLib($event: any): void {
console.log($event);
//do neccessary steps for submiting/posting tweet
}
deleteTweetLib($event: any) {
console.log($event);
//do neccessary steps for deleting a specific tweet.
}
}
Creators
Asif Isthiaq