Skip to content

Instantly share code, notes, and snippets.

@afalchi82
Created September 10, 2015 10:40
Show Gist options
  • Save afalchi82/fbae88da2db32d7078f6 to your computer and use it in GitHub Desktop.
Save afalchi82/fbae88da2db32d7078f6 to your computer and use it in GitHub Desktop.
Notes about common AngularJS elements
/* -------------------------------------------
Service
--------------------------------------------*/
// Definizione
module.service('myService', function() {
this.browsers = ['Firefox', 'Chrome', 'Internet Explorer'];
});
// Implementazione
module.controller('MyCtrl', function ($scope, myService) {
$scope.browsersList = myService.browsers;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment