0

I am new to angular2. I am facing an issue while trying to read const from external .ts file using

import {apis} from '../constants/apis';

where constants/apis.ts file is :

 export const apis = {
     lookUp: "api/getLookup.php"
 }

its giving an error GET http://localhost:3000/constants/apis 404 (Not Found)

How can i fix this issue?

I am using VSCode, the path '../constants/apis' is suggested by VSCode and it is correct.

Sabith
  • 1,628
  • 2
  • 20
  • 38

1 Answers1

0

try to write this:

import * as api from '../constants/a';
let route = api.lookUp;

you can find an answer here