When I use require or import in my Angular file, it appears to cause the controllers to be disabled.
I am trying to access data from a route and show a portion of that data on the view using angular binding. For instance, I want to display the username retrieved from the authentication route response on the main page of my single page application.
// var users = require('.../controllers/users');
// import users from ...controllers/users.js
var app = angular.module('myApp', []);
app.controller('UserController', function($scope) {
$scope.name = "John Doe";
$scope.userData = users;
});
The angular app.js file is located in the static directory, while all other files (models, routes, etc.) are stored in different directories within the root node app.