Preferred way to conditionally use iOS or Android icons


#1

Is there a preferred way to conditional use iOS or Android icons by device? Other than, an ng-if within the button bar keyed by device type.


#2

I find it useful to use something like the following instead of ng-if

ng-class="{'ion-icon1': platform == 'android', 'ion-icon2': platform == 'ios'}"

#3

Thanks, I will give it a try.


#4

Another way would be add a platform class to body attribute.

<body id="App" ng-class="{'android': platform == 'android', 'ios': platform == 'ios'}">

and then you could use css to use different ions.
LESS:

  #App {
      &.ios {
        .ion-ionX {
    	  	color: blue;
        }
      }
      &.android
      {
        .ion-ionX {
          color: green;
        }
      }
    }

CSS:

#App.ios .ion-ionX {
  color: blue;
}
#App.android .ion-ionX {
  color: green;
}

with this you can use the same icon class.