Last active
August 29, 2015 14:15
-
-
Save RickEyre/c56f6164954c7a017fb3 to your computer and use it in GitHub Desktop.
Basic Angular app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Top level app folder | |
// app/js/app.js | |
angular.module('App', [ 'Components' ]); | |
// Top level components folder | |
// app/js/components/_module.js | |
angular.module('Components', [ 'Person' ]); | |
// Top level folder in person component | |
// app/js/components/person/_module.js | |
angular.module('Person', []); | |
// PersonListController | |
// app/js/components/person/controllers/person_list_controller.js | |
function PersonListController($scope, PeopleService) { | |
$scope.everyone = PeopleService.everyone; | |
$scope.message = 'Hola!'; | |
} | |
angular.module('People').controller('PersonListController', | |
PersonListController); | |
// Person Service | |
// app/js/components/person/services/person_services.js | |
function PeopleService() {} | |
PeopleService.everyone = [ | |
'Person1', | |
'Person2' | |
]; | |
PeopleService.getPerson = function() { | |
// Something | |
}; | |
angular.module('People').service('PeopleService', PeopleService); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment