On my Stock
page, I have multiple fields labeled as Title 1
.
https://i.sstatic.net/FpCsW.png
When I run a console.log, it indicates that I am on the first page!
ngOnInit() {
this.currentPortfolio = this.shrd.getData('currentPortfolio');
this.subPage = 'stocks';
this.sectionTitle = "";
this.pageTitle = "Options";
for (var i = 0; i < this.optionsDropdownFilters.length; i++) {
this.issuers.actionsGrouped[this.optionsDropdownFilters[i]] = [];
}
console.log("First page => Tile 1 : " + JSON.stringify(this.subPage = 'stocks'));
this.initiate();
}
In Google Chrome, the display looks like this: https://i.sstatic.net/UcC1j.png
Next, when I click on the Search
button on my Stock
page...
I want to change from Title1
to Title2
.
https://i.sstatic.net/TyY80.png
Running a console.log now indicates that I am on the second page.
https://i.sstatic.net/OnSNI.png
launchSearchSelected(t) {
this.searched = true;
this.dateNotValid = false;
this.dateDoesntExist = false;
if (this.search.equityDate.length == 0) {
this.dateDoesntExist = true
}
if (t == 'A' && this.search.equityOptionCode > 0 && this.search.equityDate.length > 0) {
this.launchSearchResult(t, this.search.equityOptionCode, this.search.equityDate);
} else if (t == 'I' && this.search.indexOptionCode.length > 0 && this.search.indexDate.length > 0) {
this.launchSearchResult(t, this.search.indexOptionCode, this.search.indexDate);
}
console.log("Second Page => Title 2 " + JSON.stringify(this.searched = true));
}
Confusion arises in my HTML regarding how to toggle between the titles using boolean values.
<ng-container *ngIf="subPage === 'stocks' ">
<div class="breadcrumb d-flex justify-content-between">
<h1>Title 1 </h1>
</div>
</ng-container>