Javascript uiGmapGoogleMapApi.then未在Android上运行

Javascript uiGmapGoogleMapApi.then未在Android上运行,javascript,angularjs,angular-google-maps,Javascript,Angularjs,Angular Google Maps,我已将谷歌地图集成到我的爱奥尼亚项目中-在index.html中,我有: <script src="lib/lodash.min.js"></script> <script src="lib/angular-google-maps.min.js"></script> Inside style.css我有: .angular-google-map-container { height: 400px; } 最后,在我的天气控制器中,我有: angu

我已将谷歌地图集成到我的爱奥尼亚项目中-在index.html中,我有:

<script src="lib/lodash.min.js"></script>
<script src="lib/angular-google-maps.min.js"></script>
Inside style.css我有:

.angular-google-map-container { height: 400px; }
最后,在我的天气控制器中,我有:

angular.module('starter', ['ionic', 'uiGmapgoogle-maps']);


当我运行ionic serve时,我会在浏览器中得到一个很好的地图,它工作得很好。当我在Android(模拟器或我的物理设备)上运行它时,WeatherController是实例化的,但uiGmapGoogleMapApi.then永远不会启动。这不是为了在设备上运行吗?我在网站上看不到太多关于它的提及。

可能是因为缩小了,也可能不是。缩小时,必须使用数组注入语法:

.controller("WeatherController", [
  '$scope',
  'uiGmapGoogleMapApi',
  function ($scope, uiGmapGoogleMapApi) {
      console.log('WeatherController');
      uiGmapGoogleMapApi.then(function(maps) {
          console.log('maps API loaded; creating map');
          $scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 };
      });
  }
]);

在声明主模块启动器时,您已经在使用此语法。

这是最有趣的,我确实想知道这些语法之间的区别是什么。但是,它不能在Android上运行。:)
angular.module('starter', ['ionic', 'uiGmapgoogle-maps']);
.controller("WeatherController", function ($scope, uiGmapGoogleMapApi) {
    console.log('WeatherController');
    uiGmapGoogleMapApi.then(function(maps) {
        console.log('maps API loaded; creating map');
        $scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 };
    });
});
.controller("WeatherController", [
  '$scope',
  'uiGmapGoogleMapApi',
  function ($scope, uiGmapGoogleMapApi) {
      console.log('WeatherController');
      uiGmapGoogleMapApi.then(function(maps) {
          console.log('maps API loaded; creating map');
          $scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 };
      });
  }
]);