R
R
Roman2017-06-26 19:14:42
Angular
Roman, 2017-06-26 19:14:42

How to run angular2 + SystemJs in Visual Studio 2015?

I am migrating an existing project from angular 1 to angular 4.
The old version was built for dev mode via requireJs.
I plan a new one through SystemJs - by analogy.
I ran into a problem that the studio cannot correctly resolve imports in typescript files.
For the line import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
It gives the message " Cannot find module '@angular/platform-browser-dynamic' "
In System.config I added the appropriate paths:

System.config({
    paths: {
      'npm:': '../node_modules/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
      'app': 'app',

      // angular bundles
      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
      '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
      '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
      '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
      '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
      '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
      '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
      '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',

But how do you point the correct paths to VS?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question