title: Angular 5 Google Signin into component
body: <p>I've implemented Client Google Signin using my API Key into my html page. When I insert all the necessay tags and functions into index.html it works perfectly, but when it comes to insert the Google Signin button into a component, it is not even shown.</p>
  
  <p>So, if this is how it works in a simple html page:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Google Signin out Demo&lt;/title&gt;
  &lt;script src="https://apis.google.com/js/platform.js" async defer&gt; 
  &lt;/script&gt;
  &lt;meta name="google-signin-client_id" content="myprivateid.apps.googleusercontent.com"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;div class="g-signin2" data-onsuccess="onSignIn"&gt;&lt;/div&gt;&lt;br /&gt;
  &lt;a href="#" onclick="signOut();"&gt;Sign out&lt;/a&gt;
  
  &lt;script&gt;
    function onSignIn(googleUser) {
      var profile = googleUser.getBasicProfile();
      console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
      console.log('Name: ' + profile.getName());
      console.log('Image URL: ' + profile.getImageUrl());
      console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
      console.log(profile);
    }
  
    function signOut() {
      var auth2 = gapi.auth2.getAuthInstance();
      auth2.signOut().then(function () {
        console.log('User signed out.');
      });
    }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If I want to insert into an Angular component and leave the things as similar as I can I would left the meta-tag and the google script into the index.html and then insert the button in a component. It is not even shown. What am I getting wrong?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script src="https://apis.google.com/js/platform.js" async defer&gt; 
      &lt;/script&gt;
      &lt;meta name="google-signin-client_id" content="myprivateid.apps.googleusercontent.com"&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;app-root&gt;&lt;/app-root&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and in the specific template of the component in which I want the button to appear I insert:</p>
  
  <pre><code>&lt;div class="g-signin2" data-onsuccess="onSignIn"&gt;&lt;/div&gt;&lt;br /&gt;
  &lt;a href="#" onclick="signOut();"&gt;Sign out&lt;/a&gt;
  </code></pre>
  
  <p>Apart from the little javascript code I must add, the button is not even shown. 
  How can I fix it without installing other npm components?</p>