AngularJS: 路由显示空白页

AngularJS: Route displaying blank page

我有一个显示空白页的 route/view。我很确定它在几天前以我现在的方式工作,这让我认为这是我的 Google Maps API 键的问题,但没有错误或警告所以我认为这与我的路由设置有关。但我有另一种视图设置完全相同的方式,并且确实有效...

破损视图:http://alainwebdesign.ca/pl2/#/49.2/-122.66

工作视图:http://alainwebdesign.ca/pl2/#/getLocation

Controller(我为 Google Map API 注释掉了 the.config,因为在我看来 searchRadius.html 有一个脚本引用):

(function (window, ng) {
    ng.module('app', ['uiGmapgoogle-maps', 'ui.router'])



  .config(function ($stateProvider) { //had: , $stateChangeError included in the function parameters, but that caused error 
      $stateProvider.state('searchRadius', {
          url: '/:lat/:lon',
          templateUrl: 'searchRadius.html', //changed from  index to searchRadius.html
          controller: 'MapsCtrl',
      });
  })


  ////ALREADY HAVE GOOGLE MAPS KEY ON searchRadius.html
    .config(['uiGmapGoogleMapApiProvider', function (GoogleMapApi) {
      GoogleMapApi.configure({
          key: 'AIzaSyC_XEbbw3sNm4XlLAgqMJTggeHLDUdV-pY',
          v: '3',
          libraries: 'weather,geometry,visualization'
      });
  } ])

.controller('MapsCtrl', ['$scope', "uiGmapLogger", "uiGmapGoogleMapApi", "$interval", "$state", "$stateParams",
  function ($scope, $log, GoogleMapApi, $interval, $state, $stateParams) {
      $log.currentLevel = $log.LEVELS.debug;
      var center = { latitude: parseFloat($stateParams.lat), longitude: parseFloat($stateParams.lon) };
      alert(JSON.stringify(center));
      Object.freeze(center); //caused TypeError: Cannot assign to read only property ('latitude') ...

      console.log($stateParams);

      $scope.map = {
          center: center,
          pan: false,
          zoom: 16,
          refresh: false,
          events: {},
          bounds: {}
      };

      $scope.map.circle = {
          id: 1,
          center: center,
          radius: 500, //(current time - date lost)*km/hour
          stroke: {
              color: '#08B21F',
              weight: 2,
              opacity: 1
          },

          fill: {
              color: '#08B21F',
              opacity: 0.5
          },
          geodesic: false, // optional: defaults to false
          draggable: false, // optional: defaults to false
          clickable: true, // optional: defaults to true
          editable: false, // optional: defaults to false
          visible: true, // optional: defaults to true
          events: {
              dblclick: function () {
                  $log.debug("circle dblclick");
              },
              radius_changed: function (gObject) {
                  var radius = gObject.getRadius();
                  $log.debug("circle radius radius_changed " + radius);
              }
          }
      }

      //Increase Radius:
      $interval(function(){
            $scope.map.circle.radius += 30; //dynamic var
      }, 1000); //end of interval function


  } ]); //end of controller

})(window, angular);

searchRadius.html:

<div style="height: 100%"> <!--took out: ng-if="map.center !== undefined"-->
    <ui-gmap-google-map 
                        center='map.center'
                        zoom='map.zoom'
                        draggable='map.draggable'
                        dragging='map.dragging'
                        refresh='map.refresh'
                        options='map.options'
                        events='map.events'
                        pan='map.pan'>


        <ui-gmap-circle 
                        center='map.circle.center'
                        radius='map.circle.radius'
                        fill='map.circle.fill'
                        stroke='map.circle.stroke'
                        clickable='map.circle.clickable'
                        draggable='map.circle.draggable'
                        editable='map.circle.editable'
                        visible='map.circle.visible'
                        events='map.circle.events'>

        </ui-gmap-circle>


    </ui-gmap-google-map>
<script src='//maps.googleapis.com/maps/api/js?key=AIzaSyC_XEbbw3sNm4XlLAgqMJTggeHLDUdV-pY'></script>
</div>

将 2 个文件合并为 1 个文件,并在一行中初始化 $stateProvider。