Help refactor script into app.js


#1

Currently I have this script in my index.html inside the head tabs. I should move this to app.js, right? Either way, can you help me? How do I modify the script to fit in the angular.module app.js?

    <script>
      function initialize() {
          var mapOptions = {
              zoom: 14,
              center: new google.maps.LatLng(59.3332346,18.0280576)
          };

          var map = new google.maps.Map(document.getElementById('map-canvas'),
                  mapOptions);
      }

      function loadScript() {
          var script = document.createElement('script');
          script.type = 'text/javascript';
          script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&' +
                  'callback=initialize';
          document.body.appendChild(script);
      }

      window.onload = loadScript;
  </script>