123456789101112131415161718192021222324252627282930313233343536373839 |
- 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.entities["media"] && this.entities["media"][0]["type"] == 'photo';
- }
- }
|