ekonstantinidis/trevor

View on GitHub
www/js/services/alerts.js

Summary

Maintainability
A
0 mins
Test Coverage
var services = angular.module('services.alert', []);

services.factory('AlertService', function ($window) {

  return {
    raiseAlert : function (msg) {

      if (!$window.navigator.notification) {
        // If in browser, display NORMAL alert
        $window.alert(msg);
      } else {
        // If in device, display NATIVE alert
        $window.navigator.notification.alert(
          msg,
          false,
          'Trevor Says',
          'Okay'
        );
      }
    }
  };

});