calling angular Controller/Function from Javascript : <p>I am really new to Angular.  I am trying to execute my code defined in a controller in my app.js file.  I need to do that by a javascript.
How to do that? </p>

<p>app.js file</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>app.controller('MyLocCtrl',function($firebaseObject){
  myfunction = function () {
const rootRef =  firebase.database().ref();
this.object = $firebaseObject(rootRef);

var myLatLng = {lat: -25.363, lng: 131.044};

var map = new google.maps.Map(document.getElementById('map'),{
  zoom: 4,
  center: myLatLng
});

var marker = new google.maps.Marker({
  position: myLatLng,
  map: map,
  title: 'Hello World!'
});

};

}

);</code></pre>
</div>
</div>
</p>

<p>and my JS code in another page//map.html</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>    &lt;script src="app.js"&gt;&lt;/script&gt;
  &lt;body ng-app="app"&gt;
    &lt;div id="map" ng-app='app' ng-controller="MyLocCtrl"&gt;&lt;/div&gt;
&lt;/body&gt;

    &lt;script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDUX6F83LCTZ7_uQlXzR6_Q2u6BXFIvGkY&amp;callback=angular.element(document.getElementById('map')).firebaseObject().myfunction();"&gt;
    &lt;/script&gt;

&lt;/html&gt;</code></pre>
</div>
</div>
</p>
