Hi Guys,

Wondering if any one can help!

I've got Angular 2 working in IE9 eventually but I've now turned on routing 
and bumped into the next issue - pushState!!

I've added in history.js to polly fill the missing functionality (as can be 
seen by the console output below)

My index.html head section looks like the following...

<head>
    <title ng-bind="title">xxx</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, 
maximum-scale=1, minimum-scale=1, user-scalable=no" />
    <base href="/">

    <link rel="stylesheet" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" 
href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css";>

    <link rel="stylesheet" href="/css/style.css" />
    <link rel="stylesheet" href="/css/main.css" />

    <script 
src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.4.1/es5-shim.min.js";></script>
    <script 
src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.1/es6-shim.min.js";></script>
    <script 
src="https://cdnjs.cloudflare.com/ajax/libs/history.js/1.8/bundled/html4+html5/native.history.js";></script>

    <script src="/app/reflect.js"></script>
    <script 
src="https://code.angularjs.org/2.0.0-beta.1/angular2-polyfills.js";></script>
    <script src="https://code.angularjs.org/tools/system.js";></script>
    <script src="https://code.angularjs.org/tools/typescript.js";></script>
    <script src="https://code.angularjs.org/2.0.0-beta.1/Rx.js";></script>
    <script 
src="https://code.angularjs.org/2.0.0-beta.1/angular2.dev.js";></script>
    <script 
src="https://code.angularjs.org/2.0.0-beta.1/router.dev.js";></script>
    <script src="/app/shims_for_IE.js"></script>

    <script>
        System.config({
        packages: {        
          app: {
            format: 'register',
            defaultExtension: 'js'
          }
        }
      });
      System.import('app/boot')
            .then(null, console.error.bind(console));
    </script>

    <script type="text/ng-template" id="index.html">
        This is my body
    </script>
</head>
<base href="/">

I've tried both hash and url location strategies - both with the same 
result :(

And console.log for window.history.pushState looks like....
LOG: function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(
r))throw new Error("History.js does not support states with 
fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.
pushQueue({scope:o,callback:o.pushState,args:arguments,queue:i}),!1;o.busy(!
0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f
=o.getHashByState(a),l=o.getHash(),c=o.expectedStateId==s.id;return o.
storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),u===f?(
o.busy(!1),!1):(o.saveState(s),c||o.Adapter.trigger(e,"statechange"),!o.
isHashEqual(u,l)&&!o.isHashEqual(u,o.getShortUrl(o.getLocationHref()))&&o.
setHash(u,!1),o.busy(!1),!0)} 

With the following error being thrown, both before & after using history.js
Potentially unhandled rejection [2] TypeError: Object doesn't support 
property or method 'pushState' 

Any suggestions, help would be gratefully received.. thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to