...
| Bloco de código | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
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 | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
fooModule.factory('fooFactory', function() {
return {
foo: function() {
console.log( 'This is foo factory printing bar :)' );
}
};
});
fooModule.controller('fooController', ['fooFactory', function(fooFactory) {
fooFactory.foo();
}]); |
...
| Bloco de código | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
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 | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
fooModule.config( [ 'fooProvider', function( fooProvider ) { fooProvider.barName = 'Bar'; }]); |
| Âncora | ||||
|---|---|---|---|---|
|
...