title: Angularjs Provider: is not a function
body: <p>I am trying to configure my Module with a Provider that should allow a custom configuration. This is my Provider:</p>
  
  <pre><code>var module = angular.module('myModule', []);
  
  module.provider('MyModule', function () {
  
  
      this.setBaseUrl = function (f) {
          this.BaseUrl = f;
      };
  
      this.setOnForbidden = function (f) {
          this.onForbidden = f;
      };
  
      this.setOnTokenExpired = function (f) {
          this.onTokenExpired = f;
      };
  
      this.setOnUnauthenticated = function (f) {
          this.onUnauthenticated = f;
      };
  
      this.$get = function () {
          return this;
      };
  
  })
  </code></pre>
  
  <p>And this is my App that uses the Provider:</p>
  
  <pre><code>angular.module('myApp', ['myModule'])
  
      .config(function (MyModuleProvider) {
          MyModuleProvider.setBaseUrl("http://localhost:8080/");
  
          MyModuleProvider.setOnForbidden(
              function () {
                  console.log("Forbidden - User Function");
              }
          );
          MyModuleProvider.setOnTokenExpired(
              function () {
                  console.log("Token Expired - User Function");
              }
          );
          MyModuleProvider.setOnUnauthenticated(
              function () {
                  console.log("User Unauthenticated, wrong username or password - User Function");
              }
          );
  
      })
  </code></pre>
  
  <p>The three functions setOnForbidden, setOnTokenExpired and setOnUnauthenticated are working fine alone, but when I add the <code>MyModuleProvider.setBaseUrl("http://localhost:8080/");</code> it returns the following error:</p>
  
  <p>Failed to instantiate module myApp due to:
  TypeError: MyModuleProvider.setBaseUrl is not a function</p>
  
  <p>Why? Is there something wrong in the Provider code?</p>