I want to be able to load pages using my database.
Usually, when we use the pages they are used as component. But when I get the page name in the database its being treated as a string.
For example, in the app.component page we can see this line:
this.rootPage = FirstPage;
But when I load it using my database like this:
this.rootPage = data.value;
It shows an error. How do I load it from the database and still treat it as a component?
Currently, I am doing it in a switch statement. It works but its not clean.
Help is appreciated. Thanks!