1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import { Component, Input } from "@angular/core";
- /**
- * Generated class for the TweetBodyComponent component.
- *
- * See https://angular.io/api/core/Component for more info on Angular
- * Components.
- */
- @Component({
- selector: "tweet-body",
- templateUrl: "tweet-body.html"
- })
- export class TweetBodyComponent {
- @Input()
- data: any[];
- constructor() {}
- get status(): string {
- if (this.data["retweeted_status"]) {
- return this.data["retweeted_status"]["full_text"];
- } else {
- return this.data["full_text"];
- }
- }
- get entities() {
- if (this.data["retweeted_status"]) {
- return this.data["retweeted_status"]["entities"];
- } else {
- return this.data["entities"];
- }
- }
- get hasPhoto() {
- return (
- !this.data["private_tweet"] &&
- (this.entities["media"] && this.entities["media"][0]["type"] == "photo")
- );
- }
- }
|