Embed Twitter Timeline in Angular application.
Supported version:
Angular 18
Demo
Demo
Editor
Editor
Installation
To install this library, run:
$ npm i angular-twitter-timeline
Usage
Import in your Angular app:
import { AngularTwitterTimelineModule } from "angular-twitter-timeline";
@NgModule({
...
imports: [
...,
AngularTwitterTimelineModule
],
...
})
export class AppModule { }
Once the library is imported, you can use its component in your Angular application:
<angular-twitter-timeline
[data]="{sourceType: 'profile', url: 'mustafaer_dev'}"
[opts]="{tweetLimit: 5}"
></angular-twitter-timeline>
Data
Data can take value of url
or profile
.
If url
is set, you have to provide a valid Twitter URL;
If profile
is set, you have to set screenName
as a valid Twitter screen name. E.g. @mustafaer_dev
.
url
and screenName
are mutually exclusive.
AngularTwitterTimelineDataInterface {
sourceType: string;
screenName?: string;
url: string;
}
Options
AngularTwitterTimelineOptionsInterface {
tweetLimit?: number;
height?: number;
borderColor?: string;
theme?: string;
chrome?: string[];
ariaPolite?: string[];
}