Skip to content

Commit e25d8a9

Browse files
committed
feat(asDirective): match $destroy behaviour with ctrl.$onDestroy (see angular#14127)
1 parent f3ae979 commit e25d8a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/directive/as.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var componentAsDirective = ['$parse', function($parse) {
6666
setter(scope, controller);
6767

6868
// when the element is removed, remove it from the scope assignment (nullify it)
69-
iElement.on('$destroy', function() {
69+
scope.$on('$destroy', function() {
7070
setter(scope, null);
7171
});
7272
};

0 commit comments

Comments
 (0)