Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Creating multiple pages with similar functionality

$
0
0

@tslimone wrote:

Hi!

I’m not really used to app/web development. This doesn’t seem too hard to do, but I’m really not finding a good solution for my problem:

I’m building an app in which I have to create a bunch of pages that basically do the same. Let’s say I have A to Z “types of content”, and I have to create pages to Add, Edit and View each of those contents.

Like, the exhausting way would be to create AddA, …, AddZ, EditA, …, EditZ, ViewA, …, ViewZ. What I think would be a little smarter is to only have generic Add, Edit and View pages, and then create then accordingly. Having in mind the fields are different and can have different types of input, as well as a different function for the buttons.

As an example, let’s say I want to create the AddA page. “A” has a “name” field, which is input text, a “category” field which is a dropdown and the submit button calls a function to add the entry to my Database. I would like to go to page “Add” passing parameters like

{contentType: A},
{name: inputText},
{category: dropdown, options: [category1, category2]},
{button: {name: “Create A”, onClick: DatabaseService.CreateA(name, category)}}

I would love to have at least some guidelines to make this happen. A starting point is probably enough! :slight_smile:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>