Encountering the following error:
Uncaught ReferenceError: require is not defined(anonymous function) @ ng2-translate.ts:2
The issue arises from the line where I'm importing @anguar/http
import {provide} from '@angular/core';
import {Http} from '@angular/http';
I'm puzzled as to why this error is showing up since I have included the http dependency in my project:
package.json:
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "^2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.1",
"core-js": "^2.4.0",
"es5-shim": "^4.5.9",
"es6-shim": "^0.35.1",
"ng2-translate": "2.2.2",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "^0.19.31",
"zone.js": "^0.6.12"
},
index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Focus Anbud</title>
<base href='/'> {{content-for 'head'}}
<link rel="icon" type="image/x-icon" href="favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Loading Spinner -->
<link rel="stylesheet" href="assets/css/whirly.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/ionicons.min.css">
<!-- Theme -->
<link rel="stylesheet" href="assets/css/AdminLTE.min.css">
<link rel="stylesheet" href="assets/css/skins/skin-blue.min.css">
<link rel="stylesheet" href="assets/css/flag-icon.min.css">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!--<div class="wrapper">-->
<app>
<div class="whirly-loader" style="margin-left: 50%; margin-top:20%">Loading...</div>
</app>
<!--</div>-->
<!-- ./wrapper -->
<!-- jQuery 2.1.4 -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="assets/js/app.js"></script>
<!-- polyfills for older browsers -->
<script src="vendor/core-js/client/shim.min.js"></script>
<!-- default -->
<script src="vendor/zone.js/dist/zone.min.js"></script>
<script src="vendor/reflect-metadata/Reflect.js"></script>
<script src="vendor/systemjs/dist/system.src.js"></script>
<script src="vendor/ng2-translate/ng2-translate.js"></script>
<script>
System.baseURL = '.';
System.import('system-config.js').then(function() {
System.import('main');
}).catch(console.error.bind(console));
</script>
</body>
</html>