ndequeker
ndequeker

Reputation: 7990

AngularJS and IE8 - unsupported property or method

I'm working on supporting an existing AngularJS application to work with Internet Explorer 8. For routing, I've used the AngularUI Router framework. It provides the ui-sref directive to navigate to other states.

In the console of the IE8 Developer Tools, I get the following error for every element with the ui-sref="" attribute.

TypeError: Object doesn't support this property or method <a class=ng-binding href="" ui-sref="state-name">

Screenshot

enter image description here

Original HTML

<a ui-sref="state-name">Go to My State</a>

Probably because of this error, the navigation doesn't work. When I click the link, nothing happens.

Is there anyone who experienced similar problems before? Or can possibly guide me into the right direction?

Upvotes: 3

Views: 4923

Answers (3)

Niraj Kumar
Niraj Kumar

Reputation: 61

Check your method signature and argument expected is in synchronization. It fixed in my case.

Upvotes: 0

ndequeker
ndequeker

Reputation: 7990

The problem here is that IE8 doesn't support the method indexOf() natively.

The solution is to include a ES5 shim, which provides support for indexOf().

Upvotes: 11

Jonathan Rowny
Jonathan Rowny

Reputation: 7588

Change it to data-ui-sref rather than ui-sref

Upvotes: 0

Related Questions