Skip to content

angular 2 does not execute in the Amazon Kindle Experimental Browser #5521

@francisli

Description

@francisli

I had previously written a webapp in angular 1.x that runs in the Kindle Experimental Browser, so I was curious to see if angular 2 would also run.

The answer is, not at this time- after calling bootstrap, the component is never initialized. Since there's no debugging capability in the browser, it's impossible for me to say what's causing the issue. But, I thought I'd file the issue in case anyone else is curious.

Here's the fully self-contained angular 2 app I tested, based on the 5 min quickstart:

<html>
  <head>
    <title>Angular 2 QuickStart</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.3.1/es5-shim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.13/es6-shim.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-alpha.46/angular2.sfx.dev.js"></script>
    <script type="text/javascript">
    (function() {
      var AppComponent = ng
        .Component({
          selector: 'my-app',
          template: '<h1>My First Angular 2 App</h1>'
        })
        .Class({
          constructor: function () {
            document.getElementById('console').innerHTML = 'AppComponent instantiated';
          }
        });
      document.addEventListener('DOMContentLoaded', function() {
        ng.bootstrap(AppComponent);
        document.getElementById('console').innerHTML = 'Bootstrapping...';
      });
    })();
    </script>
  </head>
  <body>
    <my-app></my-app>
    <div id="console"></div>
  </body>
</html>

On any desktop browser, you'll see the component rendered, and my debugging "AppComponent instantiated" message in the div block below. However, in the Amazon Kindle Experimental Browser, you only see the message "Bootstrapping...".

This was tested on the current and previous generation Amazon Kindle Paperwhite with latest firmware, user agent is:

Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+

Note that BOTH the es5 AND es6 shim files were necessary for the test to even just print the "Bootstrapping..." code. Anyone have any ideas on what other polyfills/shims might address the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions