title: Using Random User generator to create profiles with angular.js
body: <p>I'm trying to get this done using the RUG (Random User Generator) API but I can't get this to work. I should be calling the http request after a click event but it doesn't seems to work. Here is what I've done (and sorry for my amateur code):</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" ng-app&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Document&lt;/title&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;div id="clk" style="background-color: indigo; widht: 100px; height: 100px"&gt;&lt;/div&gt;
  
      {{"Hello world"}}
      &lt;div ng-controller="firstController"&gt;
          {{ store.email}}
      &lt;/div&gt;
  
  
      &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>var app = angular.module('people', []);
  app.controller('firsController', ["http",function (http) {
  
      var store = this;
  
      store.products = []; 
  
  
      $http.get('http://api.randomuser.me').success(function(data){
          store.products = data.results[0].user;
      })
  }]);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>var boton = document.getElementById('clk');
  boton.addEventListener('click', function () {
      $.ajax({
        url: 'http://api.randomuser.me/',
        dataType: 'json',
        success: function(data){
          console.log(data.results[0].user);
        }
      });
  });
  </code></pre>
  
  <p>Neither of this can work. Could I get this to work, to click a button and loading a new user from the api and use it with angular?</p>