How can I access the 'name' value from a JavaScript file in an AngularJS application?
Consider the following code snippet:
var myApp = angular.module('myApp',[]);
myApp.factory('UserService', function() {
return {
name : 'blabla'
};
});
function MyCtrl($scope, UserService) {
$scope.name = UserService.name;
};