Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
themeEclipse
languagejs
titleRegistrando e Utilizando Services
linenumberstrue
collapsetrue
fooModule.service('fooService', function() {
    this.foo = function() {
		console.log('This is foo service printing bar :)');
    };
});
 
fooModule.controller('fooController', ['fooService', function(fooService) {
	
	fooService.foo();
	
}]);

...

Bloco de código
themeEclipse
languagejs
titleRegistrando e Utilizando Factories
linenumberstruecollapsetrue
fooModule.factory('fooFactory', function() {
    return {
      foo: function() {
		console.log('This is foo factory printing bar :)');
      }
    };
});
 
fooModule.controller('fooController', ['fooFactory', function(fooFactory) {
	
	fooFactory.foo();
	
}]);

...