-
-
Save JIntrocaso/8a4e520500d4e6c27c07c62c1ee64291 to your computer and use it in GitHub Desktop.
Campaign Display Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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