Sha256: abac32b3e9b4c85ec7842c921aa6ad752010a3cb0bd6e2ccb5cb319156959d80
Contents?: true
Size: 1.13 KB
Versions: 13
Compression:
Stored size: 1.13 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.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
13 entries across 13 versions & 1 rubygems