urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

Injection problem #269

Closed urbanmichal closed 7 years ago

urbanmichal commented 7 years ago

Sorry - problem is out-of-date and closed by me.


Hi guys, I've got problem with injecting moment.

angular.module( 'UWPNextApp', [ 'angularMoment' ] )

.run( ConfigurationModule.CultureConfiguration )
.run(function(amMoment)
{
    debugger;
    amMoment.changeLocale('en-gb');
});

and here everything works: I've got access to amMoment and moment in CultureConfiguration.

But I've got another controller:

module MdGenericGridModule { export class MdGenericGridComponentController implements IMdGenericGridComponentController { public static $inject = [ "$scope", "moment" ];

    constructor( public $scope: ng.IScope, public moment )

and moment is undefined.