I am attempting to change the background color of my home component page.
Here is the component.ts
import { Component } from '@angular/core'
import { ApiService } from '../_services/api.service'
import { Observable} from 'rxjs'
//import { Istock } from '../_models/istock'
import { Cagr } from '../_models/cagr'
@Component({
selector: 'app-home',
templateUrl: 'home.component.html'
})
export class HomeComponent {
public buySellData$: Observable<Cagr[]>
stock: Cagr[];
gotStocks: boolean;
gotStocks$: Observable<boolean>;
constructor(private api: ApiService){
}
exit() {
window.location.reload();
}
getStock() {
this.buySellData$ = this.api.getBuySellData();
this.buySellData$.subscribe(
// Use the `data` variable to produce output for the user
data => {
this.stock = data;
this.gotStocks = true;
}
)}
}
This is the HTML file:
<div class="bg">
<div style="text-align:center">
<h1>goop.dev</h1>
</div>
</div>
Here is the css file:
.bg { background-color:#a9c5f2; }
This a stackblitz
I have another component file that has the same code but does display the blue background, auth.component.ts
<div class="bg">
<div style="text-align:center">
<h1>goop.dev</h1>
</div>
<amplify-authenticator [signUpConfig]="signUpConfig" ></amplify-authenticator>
and auth.component.css
.bg { background-color:#a9c5f2; }