Joined January 2018
·

createthink

fe dev at createthink
·

ths

'use strict';

/* services.js */

// don't forget to declare this service module as a dependency in your main app constructor!
var appServices = angular.module('appApp.services', []);

appServices.factory('alertService', function($rootScope) {
    var alertService = {};

    // create an array of alerts available globally
    $rootScope.alerts = [];

    alertService.add = function(type, msg) {
      $rootScope.alerts.push({'type': type, 'msg': msg});
    };

    alertService.closeAlert = function(index) {
      $rootScope.alerts.splice(index, 1);
    };

    return alertService;
  });
Posted to Bubble Sort in Ruby over 1 year ago

bubble sort mark

Posted to Bubble Sort in Ruby over 1 year ago

thanks

Achievements
1 Karma
0 Total ProTip Views