<commit_before>'use strict';

angular.module('firebase.config', [])
  .constant('FBURL', 'https://snowranger.firebaseio.com');

angular.module('main', [
  'ionic',
  'ngCordova',
  'ui.router',
  'firebase',
  'firebase.config',
  'uiGmapgoogle-maps'

  // TODO: load other modules selected during generation
])
// for the camera
// http://learn.ionicframework.com/formulas/cordova-camera/
.config(function($compileProvider){
  $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|data):/); // data is safe!
})
.config(function ($stateProvider, $urlRouterProvider) {

  // ROUTING with ui.router
  $urlRouterProvider.otherwise('/main/mappy');
  $stateProvider
    // this state is placed in the <ion-nav-view> in the index.html
    .state('main', {
      url: '/main',
      abstract: true,
      templateUrl: 'main/templates/tabs.html',
      controller: 'MainCtrl as mainCtrl',
      resolve: {
        // currentLocation: function (Geolocation) {
        //   return Geolocation.get();
        // },
        here: function (Geolocation) {
          return Geolocation.get().then(function(loc) {
            return Geolocation.getNearByCity(loc.coords.latitude, loc.coords.longitude).then(function (add) {
              return {location: loc, address: add.data.results[0]['formatted_address']}
            });
          });
        },
        threeoneones: function (ThreeOneOne) {
          var query = ThreeOneOne.buildQuery(50, undefined, undefined);
          return ThreeOneOne.get311(query);
        },
        opinions: function (Opinions) {
          return Opinions.index();
        }
      }
    })
      .state('main.list', {
        url: '/list',
        views: {
          'tab-list': {
            templateUrl: 'main/templates/list.html',
            controller: 'ListyCtrl as listyCtrl'
          }
        }
      })
      .state('main.opinionDetailMappy', {
        url: 'map/opinion/:opinionId',
        views: {
          'tab-mappy': {
            templateUrl: 'main/templates/show.html',
            controller: 'ShowCtrl as showCtrl',
            resolve: {
              showResource: function () {
                return 'opinion';<commit_msg>a little documentation for the new location resolver<commit_after>'use strict';

angular.module('firebase.config', [])
  .constant('FBURL', 'https://snowranger.firebaseio.com');

angular.module('main', [
  'ionic',
  'ngCordova',
  'ui.router',
  'firebase',
  'firebase.config',
  'uiGmapgoogle-maps'

  // TODO: load other modules selected during generation
])
// for the camera
// http://learn.ionicframework.com/formulas/cordova-camera/
.config(function($compileProvider){
  $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|data):/); // data is safe!
})
.config(function ($stateProvider, $urlRouterProvider) {

  // ROUTING with ui.router
  $urlRouterProvider.otherwise('/main/mappy');
  $stateProvider
    // this state is placed in the <ion-nav-view> in the index.html
    .state('main', {
      url: '/main',
      abstract: true,
      templateUrl: 'main/templates/tabs.html',
      controller: 'MainCtrl as mainCtrl',
      resolve: {
        here: function (Geolocation) {
          return Geolocation.get().then(function(loc) {
            return Geolocation.getNearByCity(loc.coords.latitude, loc.coords.longitude).then(function (add) {
              return {location: loc, address: add.data.results[0]['formatted_address']}
            });
          });
        },
            // returns as -->
            // here: {
            //   location: {
            //     coords: {
                  // altitude: null
                  // altitudeAccuracy: null
                  // heading: null
                  // latitude: 42.40128642893472
                  // longitude: -71.12408442000427
                  // speed: null
            //   },
            //   address: '47 paulina st stomervilel'
            // }
        threeoneones: function (ThreeOneOne) {
          var query = ThreeOneOne.buildQuery(50, undefined, undefined);
          return ThreeOneOne.get311(query);
        },
        opinions: function (Opinions) {
          return Opinions.index();
        }
      }
    })
      .state('main.list', {
        url: '/list',
        views: {
          'tab-list': {
            templateUrl: 'main/templates/list.html',
            controller: 'ListyCtrl as listyCtrl'
          }
        }
      })
      .state('main.opinionDetailMappy', {
        url: 'map/opinion/:opinionId',
        views: {
          'tab-mappy': {
            templateUrl: 'main/templates/show.html',
            controller: 'ShowCtrl as showCtrl',
            resolve: {
              showResource: function () {
                return 'opinion';
{'fraction_non_alphanumeric': 0.1421085726262838, 'fraction_numerical': 0.009641584573464682, 'mean_word_length': 2.057014734144779, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1835014', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1385, 'n_words': 261}