admin管理员组

文章数量:1289525

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

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?

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

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?

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Nov 27, 2013 at 15:30 ndequekerndequeker 8,0107 gold badges62 silver badges94 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 11

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().

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

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

本文标签: javascriptAngularJS and IE8unsupported property or methodStack Overflow