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

Variable in alert controller

$
0
0

@flosrn wrote:

Hello, I want to pass a variable in an alert like this :

  const alert = this.alertCtrl.create({
      title: 'Welcome'    ********My variable here*************,
      message: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?',
      buttons: [
        {
          text: 'Disagree',
          handler: () => {
            console.log('Disagree clicked');
          }
        },
        {
          text: 'Agree',
          handler: () => {
            console.log('Agree clicked');
          }
        }
      ]
    });

I try this with :

Welcome ${profile.firstName} ${profile.LastName} !

or

'Welcome ' + profile.firstName + ' ' + profile.lastName + ' !'

but I have trouble doing it, someone knows how to do it please ?

Thanks in advance

Posts: 3

Participants: 2

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>