title: How can I use myprovider in service in angularJS
body: <p>I just referent the translateProvider in like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    var myAppModule = angular.module('myapp', ['ngRoute', 'ngMaterial', 'ngResource', 'pascalprecht.translate']);</code></pre>
  </div>
  </div>
  </p>
  
  <p>start js, and I want to use that in my commonService.js ,
  like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>myAppModule.factory('commonService', ['$resource', '$translate', function ($resource, $translate) {
          var auth = $resource('http://localhost:8012/user/auth.aspx', {}, {});
          return {
              init: function () {
                  var language = $resource("/Resources/Chinese.json");
                  language.get(function (data) {
                      console.data(data);
                  });
                  $translate.translations('en', {
                      HEADLINE: 'Hello there, This is my awesome app!',
                      INTRO_TEXT: 'And it has i18n support!'
                  })
               .translations('de', {
                   HEADLINE: 'Hey, das ist meine großartige App!',
                   INTRO_TEXT: 'Und sie untersützt mehrere Sprachen!'
               });
                  $translate.preferredLanguage('de');
              },
              submit: function (user) {
                  user.uk = "ad82544450d6fd3296878cbcd7a95d6b";
                  return auth.get(user);
              }
          }
      }]);</code></pre>
  </div>
  </div>
  </p>
  
  <p>But it alert to me:
  TypeError: undefined is not a function
      at Object.init (commonService.js:14)
      at new  (loginController.js:8)
      at Object.invoke (angular.js:4182)
      at $get.extend.instance (angular.js:8441)
      at angular.js:7693
      at forEach (angular.js:331)
      at nodeLinkFn (angular.js:7692)
      at compositeLinkFn (angular.js:7075)
      at publicLinkFn (angular.js:6954)
      at angular.js:1451
  angular.js:9814 GET <a href="http://localhost:41251/Resources/Chinese.json" rel="nofollow">http://localhost:41251/Resources/Chinese.json</a> 404 (Not Found)</p>