Á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 ServicesProviders
linenumberstrue
fooModule.provider( 'fooProvider', function() {
 
	var barName = '';
    this.foo = function() {
		console.log('This is foo service printing ' + barName + ' :)');
    };
 
	this.$get = function () {
        return this;
    };
});
 
fooModule.controller('fooController', ['foo', function( fooProvider ) {
	
	fooProvider.foo();
	
}]);

...

Bloco de código
themeEclipse
languagejs
titleRegistrando e Utilizando ServicesUtilizando Providers em Blocos de Configuração
linenumberstrue
fooModule.config( [ 'fooProvider', function( fooProvider ) {
	
	fooProvider.barName = 'Bar';
	
}]);

...