We can now add database support to our PersonalDetails class. The first thing we are going to do is update the member variables and constructor to bring in the database support and store the list of people we want to display:
- First, we add the members:
private readonly dataLayer: Database<PersonRecord>;private people: IPersonState[];
- Next, we update the constructor to hook up to the database and create TableBuilder using PersonalDetailsTableBuilder:
const tableBuilder : PersonalDetailsTableBuilder = new PersonalDetailsTableBuilder();this.dataLayer = new Database(tableBuilder.Build());
- One thing that we still have to do is add the ability to show people into our render method. In a similar way ...