Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Angular2 in MVC6 Project?

I'm facing problem with ASP.NET5 MVC6 project. I have been create project that's using AngularJS to create Single Page Application. Now I want to install Angular 2 instead of AngularJS 1.

So what should I do to upgrade the project from normal AngularJS to Angular 2.

like image 802
Ahmed El-Maghrabi Avatar asked Nov 09 '22 02:11

Ahmed El-Maghrabi


1 Answers

To get a basic application configured you need to include 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>
like image 142
TGH Avatar answered Nov 15 '22 05:11

TGH