Improve Android 2.x support with spinner change


#1

I’ve noticed that the “spiral” spinner has an issue where it breaks on Android 2.x. It uses a reserved Javascript keyword (“class”) that older VMs have an issue with, and is very easy to fix.

If you need Android 2.x support, you just need to add quotes around the “class” portion of the “spiral” spinner definition. Open ionic.bundle.js and search for the following section (around line 49746 in Ionic 1.0.0):

spiral: {
  defs: [{
    linearGradient: [{
      id: 'sGD',
      gradientUnits: 'userSpaceOnUse',
      x1: 55, y1: 46, x2: 2, y2: 46,
      stop: [{
        offset: 0.1,
        class: 'stop1'
      }, {
        offset: 1,
        class: 'stop2'
      }]
    }]

and surround the two “class” definitions with quotes, like:

spiral: {
  defs: [{
    linearGradient: [{
      id: 'sGD',
      gradientUnits: 'userSpaceOnUse',
      x1: 55, y1: 46, x2: 2, y2: 46,
      stop: [{
        offset: 0.1,
        'class': 'stop1'
      }, {
        offset: 1,
        'class': 'stop2'
      }]
    }]

Just make those two simple changes and you should be good to go.


#2

Still a problem with 1.0.1, now starting at line #49935.

I know Ionic no longer officially supports Android 2.x, so this is probably not considered a bug, but hopefully this helps those that need to support it.