3

Hi im trying to create a angular 4 application that supports L10n .I want to use globalize in the application .My component App component is below

import { Component,OnInit } from '@angular/core';
import  globalize from 'globalize';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  glb:any;
constructor()
{
  var formatter = globalize.numberFormatter();
  console.log(formatter(233));
}
ngOnInit()
{
  
  this.glb=globalize;
console.log(this.glb.currencyFormatter("1234"));
}
}

But during compilation ,im getting the below error

ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve 'globalize' in 'C:\project\aag
 @ ./src/app/app.component.ts 12:0-34
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4201 ./src/main.ts

Any help would be appreciated

Community
  • 1
  • 1
dockerrrr
  • 277
  • 1
  • 5
  • 17

1 Answers1

0

Try to import it like this

import * as Globalize from 'globalize';

tamtoum1987
  • 1,957
  • 3
  • 27
  • 56