Home:ALL Converter>What is @angular in Angular 2?

What is @angular in Angular 2?

Ask Time:2016-05-11T22:31:56         Author:Code Whisperer

Json Formatter

I am working on the Angular 2 documentation.

A lot of places, including the examples, Angular is referred to as @angular.

For example, on the API page:

https://angular.io/docs/ts/latest/api/

What is the significance of the @? Does it have any relevance to Angular 2 code?

Author:Code Whisperer,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37165779/what-is-angular-in-angular-2
Günter Zöchbauer :

It's the name used for the scope in the NPM repository \n\nhttp://blog.npmjs.org/post/116936804365/solving-npms-hard-problem-naming-packages\n\n@angular is the scope name and all modules (core, compiler, common, platform-..., testing, router, ...) are published under that scope.\n\n\nAngular2 versions after beta.x, and therefore >= Angular2 RC.0 use @angular\nVersions <= Angular2 beta.x use angular2\n\n\nOne of the reasons they changed it that they considered 2 in Angular2 a misnomer. Currently (January 2017) we are at Angular version 4.0.0-beta.1 which should make it clear, that 2 doesn't make sense.",
2016-05-11T14:33:11
Ryan McClarnon :

From the Angular Git page:\n\n\n \"All of the packages are now distributed under the @angular npm scope. >This changes how Angular is installed via npm and how you import the code.\"\n\n\nAnd from the NPM documentation pages:\n\n\n \"Scopes are like namespaces for npm modules. If a package's name begins >with @, then it is a scoped package. The scope is everything in between >the @ and the slash.\"\n\n\nHope this helps.\n\nhttps://github.com/angular/angular/blob/master/CHANGELOG.md\n\nhttps://docs.npmjs.com/getting-started/scoped-packages",
2016-06-03T15:40:20
user7388362 :

The @ indicates it is a private npm package. Only the authorized team is allowed to push new versions but it is publicly available for download. By publishing it as npm package you can use node as package manager for your application and let node manage dependencies with other packages and versions. Very useful. ",
2017-01-07T17:00:00
Apurva Singh :

Let's take case of import { NgModule } from '@angular/core'; as an example. If you look at github source, @angular is just a folder name. Let's take @angular/core. Inside is index.ts which further exports ./src/core which means .src/core.ts, since .ts extension is assumed. When you to to ./src/core.ts, you find that it exports .metadata. When you go into ./metadata, you will find ngmodule.ts. Inside this is @NgModule defined!",
2017-01-13T04:37:42
yy