My NearMe 1 app did not work out ,can some one check for me . appreciated!


#1

Those copy and pasted portion is checked without error(leaflet stuff ..) , so I just put my MainController ,view, and module here.





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


<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>

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

<script src="js/vendor/leaflet.js"> </script>
<!-- Services -->


======================= MainController
app.controller('MainController',[$scope ,function($scope){
angular.extend($scope, {
defaults: {
scrollWheelZoom: false;
}
});
}]);

====================== app.js

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


#2

update my controller based on portion 6 and portion 7 and it is still no out put.

============================================================
app.controller('MainController', ['$scope', function($scope) {$scope.mapCenter = {lat: 40.741934, lng: -74.004897, zoom: 17 }, $scope.mapMarkers = [{lat: 40.741389, lng: -74.003056, message: "111 Eighth Avenue"}, {lat: 40.7425, lng: -74.006111, message: "Chelsea Market"} ] }]);

============================================================




<script src="js/vendor/angular.min.js"> </script>
<script src="js/controllers/MainController.js"></script>

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


<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>
      <center>{{mapCenter}}</center>
      <markers>{{mapMarkers}}</markers>
    </leaflet>
  </div>
</div>

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

<!-- Controllers -->
	

<script src="js/vendor/leaflet.js"> </script>
<!-- Services -->



#3

Your problem is in the leaflet. Replace it with this one and it should work

<leaflet center="mapCenter" markers="mapMarkers">