Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
AngularJS date display using moment js

I am trying to display current date in my application using moment JavaScript library, I am getting referenceerror message.

I have the moment.js file under my scripts folder and my Bookshow.js file under resource folder.

I also referred to this link but still facing the reference issue - AngularJs and moment.js not working

Error Details

ReferenceError: moment is not defined 
at new <anonymous> (Bookshow.js:2)
at Object.instantiate (angular.js:3501)
at Object.canonymous> (angular.js: 3526)
at Object.invoke (angular.js:3492)
at Object.$get (angular.js:3112) at Object.invoke (angular.js:3492)
at angular.js:3827
at d (angular.js:3193)
at e (angular.js:3223)
at Object.invoke (angular.js:3231)

Code

Bookshow.js

book.service('ApplDate', ['$scope', '$http', '$filter', function($scope, $http, $filter) {

$scope.today = moment();
console.log("today date " + today.format('MM/DD/YYYY'));
$scope.applDate = today.format('MM/DD/YYYY');
}]);
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda