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

Convert some JS code to TS to make a similar radio button

$
0
0

@romulus64 wrote:

Hello guys,
I would like to use this code to make a kind of radio button field but I’m not an angularJS developer and I can’t understand the JS code, can someone explain me how to make something similar?

In my html page, I put this code

  <div class="button-bar padding">
      <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
     <a grouped-radio="'male'" ng-model="data.gender">Male</a>
    <a grouped-radio="'female'" ng-model="data.gender">Female</a>
  </div>

In my SCSS page :

      .button-bar > .button{
        border: 1px solid #cfcfcf;
      }

      .button-bar > .button:last-child {
        border-radius: 0px 20px 20px 0px !important;
      }
      .button-bar > .button:first-child {
          border-radius: 20px 0px 0px 20px !important;
      }

In my TS page

public data = {
		gender: 'female',
		fruit:'grapes',
		veggie: true
	  };

But the 2 texts “Male” and “Female” are inline and they are side by side.
Thanks by advance

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70433

Trending Articles



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