I'm currently developing a value selector component in ionic/angular and I've encountered an issue with the message/title that I want to pass to the component. I want to be able to specify where the selected value should appear within the message.
One solution I considered is to include a marker like %value% inside the message string for the component to process. However, I'm wondering if there's a more standard approach to handling this?
In the screenshot below, I want the
<ion-badge> {{Value}} </ion-badge>
to be displayed where the X is located.
<div class="ValueSelector_Container">
<div class="Message">
<ion-label>{{Message}} <ion-badge> {{Value}} </ion-badge> </ion-label>
</div>
...
https://i.sstatic.net/vo98Y.png
This is how I am using/hosting the current component. I will eventually handle the output of the selected value
<ValueSelectorComp Message="Play X minutes before switching to bla bla" ></ValueSelectorComp>
I have provided a code reproduction on stackblitz, here's the link
https://i.sstatic.net/xq8s7.png
If you have a working fix or suggestion, please fork and share the link. Thank you.
https://stackblitz.com/edit/ionic-fx1ktl?file=pages%2Fhome%2Fhome.ts
Ionic:
Ionic CLI : 6.13.1 (C:\Users\AXM\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 (<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9bf8f4e9fff4edfab6f7f2f9dba2b5abb5aa">[email protected]</a>)
Cordova Platforms : android 7.0.0, browser 5.0.3
Cordova Plugins : cordova-plugin-ionic-webview 1.1.1, (and 13 other plugins)
Utility:
cordova-res : 0.15.3
native-run : not installed
System:
NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.9.0
OS : Windows 10
npm show ionic version
5.4.16
npm show cordova version
11.0.0
npm show angular version
1.8.2
show @angular/core version
13.1.1