title: Uncaught ReferenceError: require is not defined in angular 2
body: <p>I work on a site with angular 2 and node.js and I'm try to connect my BDD with a JS script but when I call my script in my html file I've got the error : Uncaught ReferenceError: require is not defined.
  I'm new in angular 2 and in web but I can't see why I've got this error.
  this is my code.</p>
  
  <p>connexionsql.js :</p>
  
  <pre><code>        var mysql = require('mysql');
      var con = mysql.createConnection({
        host     : "127.0.0.1",
        user     : "root",
        password : "",
        database : "hope_to"
      });
  
      connection.connect(function(err) {
        if (err) throw err;
          con.query("SELECT nb_annee_experience FROM annee_experience", function (err, result) {
            if (err) throw err;
            console.log(result);
        });
      });
  </code></pre>
  
  <p>index.html :</p>
  
  <pre><code>        &lt;!DOCTYPE html&gt;
      &lt;html&gt;
        &lt;head&gt;
          &lt;meta charset=UTF-8&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
          &lt;title&gt;HOPE TO&lt;/title&gt;
          &lt;base href="/"&gt;
          &lt;nav&gt;
            &lt;a href="#"&gt; &lt;img src="C:\wamp64\www\angular2-seed-master\hopetotest.jpg" alt=""&gt; &lt;/a&gt;
            |
            &lt;a href="connexion/connexion.html"&gt; Connexion &lt;/a&gt;
          &lt;/nav&gt;
        &lt;/head&gt;
  
        &lt;body&gt;
          &lt;app&gt;Loading...&lt;/app&gt;
          &lt;script async src="main.bundle.js"&gt;&lt;/script&gt;
          &lt;script src="connexionsql.js"&gt;&lt;/script&gt;
        &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>