Skip to content

Instantly share code, notes, and snippets.

@JIntrocaso
Created September 25, 2020 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JIntrocaso/8a4e520500d4e6c27c07c62c1ee64291 to your computer and use it in GitHub Desktop.
Save JIntrocaso/8a4e520500d4e6c27c07c62c1ee64291 to your computer and use it in GitHub Desktop.
Campaign Display Component
<div class='hero'>
<div class='hero-overlay'>
<main>
<div>{{campaign.signupMessage}}</div>
<button class='btn-sign-up'(click)='buttonClicked()'>Click Here To Sign Up</button>
</main>
</div>
<img *ngIf="campaign.heroImageUrl" class='hero-image' [src]='campaign.heroImageUrl' alt='Campaign Image'/>
</div>
export class CampaignDisplayComponent implements OnInit {
@Input() campaign: Campaign;
@Output() signupButtonClicked: EventEmitter<boolean> = new EventEmitter<boolean>();
public heroImage = '';
public campaignDetails = 'This is some default text. If you are seeing this, your campaign is missing the signup message data.';
constructor(private campaignService: CampaignService) { }
ngOnInit(): void {
this.heroImage = this.campaign.heroImageUrl;
this.campaignDetails = this.campaign.signupMessage;
}
public buttonClicked(): void {
this.signupButtonClicked.emit(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment