First of, I know I can load AngularJS through a script tag but as I have observed it loads faster using NodeJS's require function. But how come when I load it through a script tag, it works. While using require() it doesn't.
Via script tag:
<script src="node_modules/angular/angular.min.js"></script>
Via NodeJS require():
var angular = require('angular');
I can access the "angular" variable either way in the console, but the second one doesn't seem to work as I expect.
EDIT: I have already installed AngularJS using npm. I have also read from their NPM page that it can be used also through require(). But it just doesn't seem to work for me.