-
-
Save JIntrocaso/bb7fb412136e4661043b722b8a0ab436 to your computer and use it in GitHub Desktop.
Landing Page Code
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
<h1 *ngIf='campaign'>{{campaign.headline}}</h1> | |
<app-campaign-display *ngIf='!showSignupForm && !loading' (signupButtonClicked)='handleSignupButtonClick($event)' [campaign]='campaign'></app-campaign-display> | |
<app-campaign-signup *ngIf='showSignupForm && !formSubmitted && !loading' (submitButtonClicked)='showThankYou($event)' [campaign]='campaign'></app-campaign-signup> | |
<app-campaign-thankyou *ngIf='formSubmitted && !loading' [campaign]='campaign'></app-campaign-thankyou> |
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
import { Component, OnInit } from '@angular/core'; | |
import { CampaignService } from 'src/app/services/campaign.service'; | |
@Component({ | |
selector: 'app-landing-page', | |
templateUrl: './landing-page.component.html', | |
styleUrls: ['./landing-page.component.scss'] | |
}) | |
export class LandingPageComponent implements OnInit { | |
public campaignTitle = 'Campaign Title Goes Here'; | |
public showSignupForm = false; | |
public formSubmitted = false; | |
public campaign; | |
public loading = true; | |
constructor(private campaignService: CampaignService) { } | |
ngOnInit(): void { | |
this.campaignService.getCampaignData().subscribe(res => { | |
console.log(res); | |
this.campaign = res; | |
this.loading = false; | |
}); | |
} | |
public handleSignupButtonClick(value): void { | |
this.showSignupForm = value; | |
} | |
public showThankYou(value): void { | |
this.formSubmitted = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment