I want to use web3 from loginmain.js file. My project hierarchy looks like:
Project/
www/
login.html
js/
login.js
app/
loginmain.js
lib/
jquery.js
web3.js
tools/
my loginmain.js file :
define(function (require) {
var $ = require('jquery'),
Web3 = require('web3'),
lib = require('./lib'),
controller = require('./controller/c1'),
model = require('./model/m1');
//A fabricated API to show interaction of
//common and specific pieces.
var web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8000'));
console.log(web3);
controller.setModel(model);
$(function () {
controller.render(lib.getBody());
});});
I get the following Error
TypeError: Web3 is undefined
Any idea how can I solve it ?