質問

I have an angular model page that has an array images. In my template I have this:

<div slide="slide" ng-repeat="slide in page.images" active="slide.active">

and I have tried to have es5-shim.js imported in all orders of precedence that can be. All other browsers render it correctly , except document mode IE8 (sharepoint 2010 forces this). In that I get:

TypeError: Object doesn't support this property or method<div class="item text-center ng-isolate-scope" active="slide.active" ng-repeat="slide in page.images" slide="slide" ng-transclude ng-class="{&#10;    'active': leaving || (active &amp;&amp; !entering),&#10;    'prev': (next || active) &amp;&amp; direction=='prev',&#10;    'next': (next || active) &amp;&amp; direction=='next',&#10;    'right': direction=='prev',&#10;    'left': direction=='next'&#10;  }" ng-1398662894321="121">

The result is that inside that div, an <img ng-src="{{ slide.url }}" image gets a bad URL.

If I remove es5-shim.js I get also an error about not supported indexOf for the same row. Weird thing is, ng-repeat is working elsewhere in the app where I use angular-treeview.

What type error is this, if not indexOf, and is there a way to fix it?

役に立ちましたか?

解決

you are using "slide directive" => slide="slide" and another slide in ng-repeat="slide in page.images" they are conflicting.

one more suggestion, always prefix your directive. like ct-slide (ctSlide in javascript)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top