2015-06-12 14 views
0

我想在AngularJS中根據位置顯示一個簡單的指令。AngularJS自定義Google Maps指令的錯誤:'getComputedStyle'在'窗口'上:參數1的類型不是'Element'。

I'm收到此錯誤:Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.

我創造未來plunker重現該問題:http://plnkr.co/edit/Fnmanw1sjblKTJNmYGaV?p=preview

+1

通常建議在SO上也包含代碼,以防外部引用co de不再可用了 – superjos

回答

5

更改此:

var map = new google.maps.Map(element, mapOptions); 

要這樣:

var map = new google.maps.Map(element[0], mapOptions); 
相關問題