Difference between @angular/core and angular 2/core
Basically these two reference we used when we import some classes like 'Component' and we used the classes in our typescript(.ts) file .
Initially when angular 2 was in Beta version we were using the namespace angular2/core to import any class in our typescript file.
But when angualar 2 was released in RC(Release Candidate) mode then we used @angular/core to import any class in our typescript file. In Release candidate mode Angular team repackaged all the packages and distributed @Angular npm scope.
So one thing i just want to mention here that when you will used this "angular2/core", you should see a folder structure in your application root folder like
E:\Projects\Demo\node_modules\@angular\core
Note:
This folder creation will done npm .When you will execute the command 'npm install' it will create all those angular dependency as per package.json file configuration.
If you want to check more on package.json and how to create a angular application you can check here (https://whymysolutions.blogspot.in/2017/08/angular-2-application-using-visual.html)
Initially when angular 2 was in Beta version we were using the namespace angular2/core to import any class in our typescript file.
But when angualar 2 was released in RC(Release Candidate) mode then we used @angular/core to import any class in our typescript file. In Release candidate mode Angular team repackaged all the packages and distributed @Angular npm scope.
So one thing i just want to mention here that when you will used this "angular2/core", you should see a folder structure in your application root folder like
E:\Projects\Demo\node_modules\angular2\core
But If you will import any class by this reference "@angular/core",then you should see the folder structure like thisE:\Projects\Demo\node_modules\@angular\core
Note:
This folder creation will done npm .When you will execute the command 'npm install' it will create all those angular dependency as per package.json file configuration.
If you want to check more on package.json and how to create a angular application you can check here (https://whymysolutions.blogspot.in/2017/08/angular-2-application-using-visual.html)
Thanks for sharing this difference admin, it is really helpful. I learned a lot and I have bookmarked this page for my future reference.
ReplyDeleteAngular 2 Training in Chennai | Angular 4 Training in Chennai
Thanks a lot Priya.
ReplyDelete