Árvore de páginas

Versões comparadas

Chave

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

...

Bloco de código
languagejs
titleExemplo
firstline1
linenumberstrue
collapsetrue
sampleController.$inject = ['$rootScope', '$scope', 'totvs.app-notification.Service'];
function sampleController($rootScope, $scope, appNotificationService) {

	// Exemplo de chamada direta ao sistema de notificação:
	appNotificationService.message({
    	title: 'l-attention',
        text: 'Vamos lhe fazer uma pergunta.',
        help: 'Se precisar de ajuda, chame os universitários.',
        size: 'lg',  //opicional
        callback: function() {
        	appNotificationService.question({
            	title: 'l-question',
                text: 'Hoje é sexta-feira?',
                cancelLabel: 'l-no', // Padrão é 'cancel'
                confirmLabel: 'l-yes', // Padrão é 'ok'
                callback: function(isPositiveResult) {
                	var alert = {
                    	type: 'error',
                        title: 'Atenção',
				        size: 'md',  //opicional
                        detail: 'Hoje não é sexta-feira :('
                    };
                    if (isPositiveResult) {
                    	alert.type = 'success';
                        alert.detail = 'Hoje é sexta-feira :)'
                    } 
                    appNotificationService.notify(alert);
				}
			});
		}
	});
}

...