HABPanel Connection Lost - JavaScript Error undefined $injector:modulerr on iPad with JavaScript 1.7

Not sure what I’m chasing, but I’m getting a JavaScript Error on Safari and Chrome on my OLD iPad (JavaScript 1.7, iOS 5.1.1).

When navigating to HABPanel UI, I simply get the Connection Lost! message. I understand this is probably the catch that JavaScript punted. I enabled the Safari debug console and indeed see there is an error under the covers.

JavaScript: Error
undefined
Error: [$injector:modulerr] http://errors.anjularjs.org/1.5.11/$injector/modulerr?p0=ng&p1=‘undefined’%20is%20not%20an%20object

From my research, it appears that there is possibly a ‘ng’ module inclusion issue here.

This could be a version issue with my ancient iPad, but I would really like to use it as a always on dashboard so if there is is a fix that would be awesome.

Any guidance would be appreciated.

Tony

No idea sorry :frowning: Then again iOS 5.1.1 is really old, I wouldn’t be surprised the Safari version that shipped with it isn’t compatible at all.

Yeah, but the Javascript is 1.7 and should be generally compatible. I think it’s just a bit more picky about its require statements. I hope there is a way to maintain compatibility. It would be a great way for a lot of people to put these devices to use.

A definitive statement on what JS is supported might help in this quest.

I second this. iPad would be great to use as interface, stuck to the wall, but it doesn’t work at the moment and that is a shame…

1 Like

Developers are making some headway by using a workaround for the lack of bind() support.

HABPanel Issue opened for this…

Polyfill Reference

Goes in of index.html

if (!Function.prototype.bind) {
  Function.prototype.bind = function(oThis) {
    if (typeof this !== 'function') {
      // closest thing possible to the ECMAScript 5
      // internal IsCallable function
      throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
    }

    var aArgs   = Array.prototype.slice.call(arguments, 1),
        fToBind = this,
        fNOP    = function() {},
        fBound  = function() {
          return fToBind.apply(this instanceof fNOP
                 ? this
                 : oThis,
                 aArgs.concat(Array.prototype.slice.call(arguments)));
        };

    if (this.prototype) {
      // Function.prototype doesn't have a prototype property
      fNOP.prototype = this.prototype; 
    }
    fBound.prototype = new fNOP();

    return fBound;
  };
}