0

I have a HTML like following;

  <div class="tab-content">
    <div ng-repeat = "(key,val) in reportCollection" id="{{val.url}}" class="tab-pane fade in" ng-class="{'active': $index == 0}" repeat-done="layoutDone()">
      <object data="{{val.url}}/index.php" style="width:100%;height:80%;"></object>
    </div>
  </div>

Now via a controller I am updating a model "reportCollection" after an ajax call,

$http.get("ajax_config.php")
        .then(function(response) {
            $scope.reportCollection = response.data;

        });

In Chrome and Firefox soon after updating model different http request is being sent for different object tag inside ng-repeat(I checked from developer console and network tab). So everything is fine.

But in Edge different ajax call is being occurred but the ajax call path is val.url not the actual urls inside the collection.

As for example lets say my collection is;

var reportCollection = [

              {'url':'test.html',....},
              {'url':'myPage.html',....}

]

Now http request url in chrome and firefox as;

     http://.../.../.../test.html
     http://.../.../.../mtPage.html

But in edge it is like;

     http://.../.../.../%7B%7Bval.url%7D%7D/

So clearly it is taking as {{val.url}} as URL.

Can you please give me a detail insight about why is this happening and how to resolve it?

2 Answers 2

1

I believe this issue is covered in this post: angularjs expression in html tag

Basically, Edge is evaluating the data attribute before angular has a chance to replace the val.url property. Try using the accepted answer on the link above.

Sign up to request clarification or add additional context in comments.

1 Comment

Solved my issue.
0

Try, to make it this way:

 <object data="{{val.url+'/index.php'}}" ....>

Or:

<object ng-attr-data="{{....}}" >

2 Comments

Didn't work, now it is like %7B%7Bval.url+'/index.php'%7D%7D
It looks like Edge interprets the curly-braces differently, have you tried to just output the result of your using ng-attr? <object ng-attr-data="{{....}}" >

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.