Skip to content

Commit 3cdfde0

Browse files
committed
[map-lazy-load] avoid using the same content of savedHtml.
1 parent 9333d52 commit 3cdfde0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

directives/map-lazy-load.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/* global window, document */
3737
(function() {
3838
'use strict';
39-
var $timeout, $compile, src, savedHtml, elements = [];
39+
var $timeout, $compile, src, savedHtml = [], elements = [];
4040

4141
var preLinkFunc = function(scope, element, attrs) {
4242
var mapsUrl = attrs.mapLazyLoadParams || attrs.mapLazyLoad;
@@ -45,7 +45,7 @@
4545
elements.push({
4646
scope: scope,
4747
element: element,
48-
savedHtml: savedHtml,
48+
savedHtml: savedHtml[elements.length],
4949
});
5050

5151
window.lazyLoadCallback = function() {
@@ -77,7 +77,7 @@
7777
var compileFunc = function(tElement, tAttrs) {
7878

7979
(!tAttrs.mapLazyLoad) && console.error('requires src with map-lazy-load');
80-
savedHtml = tElement.html();
80+
savedHtml.push(tElement.html());
8181
src = tAttrs.mapLazyLoad;
8282

8383
/**

0 commit comments

Comments
 (0)