I want to know how to retain the value in the textbox after we change the page and then come back again to the same page. Here I have a page called Transaction that accepts a value via textbox and when I click on its search button it shows the details by searching through the database. And then in the input data, I have a button called as Payload that when clicked shows Payload Data, now when I cancel that Payload page, Transaction page reloads (comes back) but without any data(entry) in the search box. I want the same data on basis of which search occurred to appear in the textbox again.
<td style="width:50%">
<input class="form-control" id="input1-group1 " style="margin-top:20px"
type="text" name="search" placeholder="Enter Search Text"
[(ngModel)]="filterdata" >
</td>
<td style="width:50%">
<button type="submit" class="input-group-addon"
style="margin-left:0px;width:65px;margin-top:20px" id="faIcon"
(click)="searchByText(filterdata)">
<i class="fa fa-search "></i>
</button>
</td>
Child: {{sharedVar}}
........because in my component i have templateUrl: './transaction.component.html' <-- like this. Can i implement it in my html directly – May 16 '18 at 03:34