Stuck on step 4 map does not show


#1

Here is my code

`

  <head>
    <link href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet" />
    <link href="css/leaflet.css" rel="stylesheet" />

    <script src="js/vendor/angular.min.js"></script>
   
    <script src="js/vendor/leaflet.js"></script>
    <script src="js/vendor/angular-leaflet-directive.min.js"></script>

  </head>
  <body ng-app="NearMeApp">
    
    <div class="header">
      <div class="container-fluid">
        <h1 class="pull-left">NearMe</h1>
      </div>
    </div>

    <div class="main" ng-controller="MainController">
      <div class="container-fluid" id="map-canvas">
        <leaflet></leaflet>
      </div>
    </div>

    <!-- Modules -->
    <script src="js/app.js"></script>

    <!-- Controllers -->
		<script src="js/controllers/MainController.js"></script>

    <!-- Directives -->
    

    <!-- Services -->
    
  </body>
</html>`

app.js

var app = angular.module('NearMeApp', ['leaflet-directive']);

MainController.js
app.controller('MainController', ['$scope'], function($scope){});

Any help leading or explaining the error would be appreciated.


#2

Hello,

The issue seems to be with the controller. Please see below for corrected code:

app.controller('MainController', ['$scope', function($scope){
}]);

You are closing the square bracket incorrectly ('MainController', ['$scope'],). The square bracket needs to be closed after defining the $scope

Hope it helps :slight_smile:


#3

Step 1 and 2 look correct. There is an error in Step 3.

Incorrect: app.controller('MainController', ['$scope'], function($scope){});

Correct: app.controller('MainController', ['$scope',function($scope){}]);