I just begin with angular2 and typescript and I'm facing an issue. I made a little library in the folder web-project/api:

  • package.json
  • core.ts
  • typings.json

and an angular2 project in /web-project/angular2 based on the Tour-Of-Heroes from the angular website: https://angular.io/docs/ts/latest/

I used npm install ../api and import my class like this:

    import { Session } from 'api/core'

That's compile without error or warning. But when I'm trying it in my browser, nothing works and I'm facing an angular error due to an HTTP error -> GET /localhost/api/core Returning 404, of course I don't have any file named core.

So two questions:

  1. Why my lib is not embedded like my others ts files?
  2. How to embedded my lib or specified where to find the proper js file?
share|improve this question
    
Could you post content of core.ts? – kemsky Apr 18 at 19:36
    
I don't have my laptop with me, but it's something like this: export class Session { doIt() {} } – Gnukos Apr 18 at 19:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.