Sha256: 21fff6cf7047ab2b7a88b270d46b2997f7869dae50e0c7c395b4ed71087a45fc
Contents?: true
Size: 1.48 KB
Versions: 12
Compression:
Stored size: 1.48 KB
Contents
angular.module("oxymoron.notifier", []) .run(['$rootScope', 'ngNotify', 'Validate', '$state', '$http', '$location', 'Notice', function ($rootScope, ngNotify, Validate, $state, $http, $location, Notice) { ngNotify.config({ theme: 'pure', position: 'top', duration: 2000, type: 'info' }); var callback = function(type, res) { if (res.data && angular.isObject(res.data)) { if (res.data.msg || res.data.error) { Notice.callback(type, res); } if (res.data.errors) { Validate(res.data.form_name || res.config.data.form_name, res.data.errors) } if (res.data.reload) { if (res.data.redirect_to_url) { window.location = res.data.redirect_to_url; } else if (res.data.redirect_to) { $state.transitionTo(res.data.redirect_to, res.data.redirect_options || {}, {notify: false, location: true, reload: true}); } } else { if (res.data.redirect_to_url) { $location.url(res.data.redirect_to_url); } else if (res.data.redirect_to) { $state.go(res.data.redirect_to, res.data.redirect_options || {}); } } if (res.data.reload) { window.location.reload(); } } } $rootScope.$on('loading:finish', function (h, res) { callback('success', res) }) $rootScope.$on('loading:error', function (h, res, p) { callback('error', res) }) }])
Version data entries
12 entries across 12 versions & 1 rubygems