Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

ASP.NET 5, referencing angular2 in node_modules #248

Closed
@chickencoding123

Description

@chickencoding123

I have the following solution structure:

-WebApplication
--->project.json
--->package.json
.....
------>node_modules
.....
------>wwwroot
.....
--------->ts
------------>main.ts
------------>tsconfig.json
------------>tstypings.json
.....

inside of main.ts, i have to reference angular2 like the following:

import {bootstrap}    from '../../../node_modules/angular2/platform/browser';
import {Component}    from '../../../node_modules/angular2/core';

@Component({
    selector: 'my-app',
    template: '<h1>My First Angular 2 App</h1>'
})
export class MyApp{ }
bootstrap(MyApp);`

Why can't I use what angular suggest for imports:

`import {Component} from 'angular2/core';

Their article: https://angular.io/docs/ts/latest/quickstart.html

Furthermore, what i already have only works at design time. Once i run the project, inside of browser i get 404 not found for both browser and core. Apparently there is an ajax call to download both of these files, which fails. I'm not sure how the URL should even look like as that referencing is what i found to let me even build the project and not complaining about modules not found. However, it's not working at run-time.

Any ideas on what's causing this issues?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions