Josef Sábl
Josef Sábl

Reputation: 7742

JSPM fails to load Angular2

I followed this cheat sheet to make the Angular2 run using JSPM.

Everything seems to work except one thing, I get this message in browsers console:

http://myapp.loc/vendor/jspm_packages/npm/[email protected]/angular2.js 404 (Not Found)

The URL is not correct and in the file system I see it should be like:

http://nettebase.loc/vendor/jspm_packages/npm/[email protected]/bundles/angular2.js

Note the bundles part. When I include this manually it works but that is something I don't want to do.

What is wrong? I didn't specify that URL anywhere so I guess that JSPM manages that.

I am new to all this stuff so it is all magic to me, so I followed the tutorial and this is something I seem unable to crack.

Upvotes: 0

Views: 49

Answers (1)

Josef Sábl
Josef Sábl

Reputation: 7742

I found out that those examples use old Angular2 version, in current version you should use imports like this:

import {
    Component
} from 'angular2/core';

import {
    bootstrap
} from 'angular2/platform/browser';

Instead of

import {
    Component,
    bootstrap
} from 'angular2/angular2';

That is prevalent in many examples.

Upvotes: 0

Related Questions