-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
Is more a question than an error, I already know in a browser environment the net module is supposed to not exists, but I'm writing a electron app with angular2 and i've tested this script:
<script>
var connection = mysql.createConnection({
host : 'localhost',
user : 'user',
password : 'password',
database : 'test'
});
console.log( connection.connect() )
</script>and is working good, since electron is node based and can interact with filesystem and net.
But the problem come when I try to put in a angular2 component this:
import { Component } from '@angular/core';
import * as mysql from 'mysql';
export class AppComponent {
constructor() {
var connection = mysql.createConnection({
host : 'localhost',
user : 'user',
password : 'password',
database : 'test'
});
console.log( connection.connect() )
}
}it says: Net.createConnection is not a function..so my question is.. why? what's happening?
Any hint is appreciated. Many thanks in advance.