kennethlynne/generator-angular-xl

View on GitHub
templates/javascript/service/provider.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

angular.module('<%= scriptAppName %>')
  .provider('<%= cameledName %>', function () {

    // Private variables
    var salutation = 'Hello';

    // Private constructor
    function Greeter() {
      this.greet = function () {
        return salutation;
      };
    }

    // Configuration API
    this.setSalutation = function (s) {
      salutation = s;
    };

    this.$get = function () {
      return new Greeter();
    };
  });