Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-if removes child element before destroying scope #3237

@andrewdavey

Description

@andrewdavey

Currently ng-if removes the child element before destroying the child scope.

https://github.com/angular/angular.js/blob/master/src/ng/directive/ngIf.js#L90

I'm creating a directive that wraps Uploadify file upload control. The directive destroys the Uploadify widget when the scope gets the $destroy event.

When placed inside something with ng-if applied, destroying the Uploadify widget causes exceptions in IE8. Uploadify gets the SWF element by ID, but ng-if has already detached the elements from the DOM, so getElementById returns null.

Is it OK to simply reorder the code in ng-if to destroy the scope first? Or does that break other things?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions