How to install Angular2 in MVC6 Project

I ran into a problem with an ASP.NET5 MVC6 project. I created a project that uses AngularJS to create a single page application. Now I want to install Angular 2 instead of AngularJS 1.

So what should I do to upgrade a project from regular AngularJS to Angular 2.

+4
source share
2 answers

To configure the main application, you need to enable angular2 and configure system.js

Here is an example from the documentation ( https://angular.io/guide/quickstart ):

<html>
  <head>
    <title>Angular 2 QuickStart</title>
    <script src="../node_modules/systemjs/dist/system.src.js"></script>
    <script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
    <script>
      System.config({
        packages: {'app': {defaultExtension: 'js'}}
      });
      System.import('app/app');
    </script>
  </head>
  <body>
    <my-app>Loading...</my-app>
  </body>
</html>
0
source

- - wwwroot, wwwroot . node_modules wwwroot - .

, - node_modules wwwroot .

systemjsconfig.js!

0

Source: https://habr.com/ru/post/1614960/


All Articles