...
| Bloco de código | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
shieldModule.service( 'DialogService', function() {
this.visible = false;
this.isOpen = function() {
return visible;
};
this.show = function() {
this.visible = true;
};
this.hide = function() {
this.visible = false;
};
});
shieldModule.controller( 'UserProfileController', [ 'DialogService', '$scope', function( DialogService, scope ) {
// ...
// ...
// metodo chamado ao clicar no botão link 'Abrir Profile'
scope.openUserProfile = function() {
if ( !DialogService.isVisibleisOpen() ) {
DialogService.show();
}
};
}]); |
...