Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Angular 1.0.0 ng-template causing errors in IE 11 and Safari 7 #1572

Open
OzzieOrca opened this issue Oct 23, 2014 · 0 comments
Open

Angular 1.0.0 ng-template causing errors in IE 11 and Safari 7 #1572

OzzieOrca opened this issue Oct 23, 2014 · 0 comments
Labels

Comments

@OzzieOrca
Copy link

I had most of my component not load in only IE and Safari because of a NoSuchMethodError with the following code. I've tested this in IE 11 and Safari 7. You can see more info about the error at http://stackoverflow.com/questions/26482931/angulardart-1-0-0-has-issues-in-ie-11-and-safari-7-and-below.

page is an instance variable in my component. Here is my code from AngularDart 0.14.0 that broke upon upgrading to 1.0.0:

<template id="dynamic_button.html" type="text/ng-template">
    <a href="{{ widget.button.uri }}" type="button" class="btn btn-primary" ng-show="widget.button != null" target="{{ widget.button.target }}">{{ widget.button.label }} <span class="glyphicon glyphicon-chevron-right"></span></a>
</template>
<div ng-repeat="widget in page.widgets">
    ...
    <p ng-include="dynamic_panel_button.html"></p>
    ...
</div>

I had to rearrange it to be:

<div ng-repeat="widget in page.widgets">
    <template id="dynamic_button.html" type="text/ng-template">
        <a href="{{ widget.button.uri }}" type="button" class="btn btn-primary" ng-show="widget.button != null" target="{{ widget.button.target }}">{{ widget.button.label }} <span class="glyphicon glyphicon-chevron-right"></span></a>
    </template>
    ...
    <p ng-include="dynamic_panel_button.html"></p>
    ...
</div>

and it worked in IE and Safari. I'm assuming this is some sort of scoping issue or just checking for null in the right places. widget is defined where the <template> is placed in the new code. I guess dart2js outputted code that tried to evaluate the template on its own before it was included in the ng-include.

Now I have that template being repeated many times but at least the whole component doesn't die in IE and Safari.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants