Skip to content

Commit e94aaff

Browse files
近藤健近藤健
近藤健
authored and
近藤健
committed
Fix Memory Leak.Inspite of creating new scope, it isn't used and called method
1 parent 5e88789 commit e94aaff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/viewDirective.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ function $ViewDirective( $state, $injector, $uiViewScroll) {
202202
}
203203

204204
function updateView(firstTime) {
205-
var newScope = scope.$new(),
205+
var newScope,
206206
name = currentEl && currentEl.data('$uiViewName'),
207207
previousLocals = name && $state.$current && $state.$current.locals[name];
208208

209209
if (!firstTime && previousLocals === latestLocals) return; // nothing to do
210-
210+
newScope = scope.$new();
211211
var clone = $transclude(newScope, function(clone) {
212212
renderer.enter(clone, $element, function onUiViewEnter() {
213213
if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {

0 commit comments

Comments
 (0)