title: How do I add a google cloud endpoints client library to a yeoman generated angular app?
body: <p>I have generated a angular app using <code>yo angular</code>. I then add the <code>&lt;script src="https://apis.google.com/js/client.js?onload=init"&gt;
  &lt;/script&gt;</code> and </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function init(){
        window.init();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>to the generated index.html. In the generated controller I add</p>
  
  <pre><code>$window.init= function() {
          $scope.$apply($scope.loadScoreboardLib);
      };
  $scope.loadScoreboardLib = function() {
      var ROOT = 'https://id.appspot.com/_ah/api';
      gapi.client.load('name', 'v1', function() {
          $scope.isBackendReady = true;
          $scope.list();
      }, ROOT);
  };
  </code></pre>
  
  <p>But when saving the file I get gapi not defined. Have I placed the code in the wrong place or what is the problem? I see that gapi isn't declared but viewing some examples it seems as no one is declaring it explicitly, so I just assumed it was google magic or the lack of knowledge I have.</p>