Histórico da Página
...
Bloco de código | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
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.', 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', detail: 'Hoje não é sexta-feira :(' }; if (isPositiveResult) { alert.type = 'success'; alert.detail = 'Hoje é sexta-feira :)' } appNotificationService.notify(alert); } }); } }); } |
...
Bloco de código | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
sampleController.$inject = ['$rootScope', '$scope']; function sampleController($rootScope, $scope) { // Exemplo de chamada por evento ao sistema de notificação: $rootScope.$broadcast(TOTVSEvent.showNotification, { type: 'info', title: 'Evento', detail: 'Esta notificação foi disparada através de um evento.' }); } |
...
Definição
Cada produto é livre para definir a forma como irá gerenciar suas notificações.
...
Bloco de código | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<html> <head>Exemplo</head> <body> <!-- Diretiva definida para utilização do sistema de notificação via toaster. Caso não seja necessária a utilização basta remover a tag abaixo. --> <toaster-container toaster-options="{'time-out': 5000}"></toaster-container> </body> </html> |
...
Bloco de código | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
// Controller principal para resolução das interações da aplicação que não // dizem respeito ao programa aberto (content). // Em resumo, é responsável pela barra de navegação e 'menus', entre outros. appMainController.$inject = ['$rootScope', '$scope', 'totvs.app-notification.Service']; function appMainController($rootScope, $scope, appNotificationService) { ... // appNotificationService // Para evitar que todos os demais AngularJS Controllers e Services precisem // injetar o serviço de notificação, o serviço pode ficar disponível através // de eventos. Para isto basta injetar o appNotificationService no // appMainController para dar suporte as notificações. $scope.$on(TOTVSEvent.showNotification, function (event, alerts) { appNotificationService.notify(alerts); }); $scope.$on(TOTVSEvent.showMessage, function (event, message) { appNotificationService.message(message); }); $scope.$on(TOTVSEvent.showQuestion, function (event, question) { appNotificationService.question(question); }); } |
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas