Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Cannot inject amMoment for configuration #262

Open
meredrica opened this issue Aug 10, 2016 · 0 comments
Open

Cannot inject amMoment for configuration #262

meredrica opened this issue Aug 10, 2016 · 0 comments

Comments

@meredrica
Copy link

Hello!

I cannot get the amMoment object injected in my angular app (written in timescript).

(function () {
  angular.module('app.config', ['angularMoment']);
}());

namespace app.config {
  angular
    .module('app.config')
    .config(AmMomentConfig);

  AmMomentConfig.$inject=['amMoment'];

  function AmMomentConfig($amMoment:any) {
    amMoment.setLocale('de-at');
  }
}

I also tried using the $injector like so:


namespace app.config {

  angular
    .module('app.config')
    .config(AmMomentConfig);

  AmMomentConfig.$inject=['$injector'];

  function AmMomentConfig($injector:any) {
    $injector.get('amMoment');
  }

}

injection works ($inject is there) but the moment i want to inject amMoment, I get an UnknownProvider error.
Any idea what could go wrong here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant