What is @angular in Angular 2?
NickName:Code Whisperer Ask DateTime:2016-05-11T22:31:56

What is @angular in Angular 2?

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?

Copyright Notice:Content Author:「Code Whisperer」,Reproduced 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

Answers
Günter Zöchbauer 2016-05-11T14:33:11

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.",


Ryan McClarnon 2016-06-03T15:40:20

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",


user7388362 2017-01-07T17:00:00

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. ",


Apurva Singh 2017-01-13T04:37:42

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!",


More about “What is @angular in Angular 2?” related questions

What is @angular in Angular 2?

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/ Wh...

Show Detail

What is the equivalent of angular.isFunction in angular 2

In angular 1.x we use this angular.isFunction function to determines if a reference is a Function. What is the equivalent of that function in Angular 2. Checked in doc. But did not get anything. ...

Show Detail

What are Components in Angular 2

I am new to Angular thing and have very little experience with Angular JS 1.x generation. However my question is about Angular 2. I was reading about Components here and https://angular.io/docs/ts/...

Show Detail

What is angular2 typescript and angular2 ecma script

I'm learning Angular2. What is the difference between Angular2 with typescript and angular2 with ecmascript?

Show Detail

What version of Angular material should be used for angular2?

I started learning angular 2. I am trying to use angular material in my sample application. I have installed angular material using this command "npm install --save @angular/material". I understood...

Show Detail

What is $implicit in angular 2?

How is the following keyword used in angular2 ng-templates What is the purpose of $implicit in angular 2 templates? What is relationship between let-&lt;attribute&gt; and $implicit?

Show Detail

What is Angular 2 RC angular2-in-memory-web-api?

What is angular2-in-memory-web-api? I've seen references to it in the angular.io documentation but my code seems to work without it.

Show Detail

Angular2 Difference between @angular/ and angular2/ imports

While looking at some Angular2 project, I see two different kind of imports : some are starting with @angular/ like @angular/core by instance, and some others with angular2 (angular2/core). What's...

Show Detail

Angular 2 : what make a service to be "Outside" angular zone?

After having same issues as many people on StackOverflow i didn't manage to understand what is an "Outside angular zone" Service ? I've checks all existing questions around this subject, and it's

Show Detail

What is the proper way of importing Angular 2 modules into the Angular2-Meteor package?

I'm using the Angular2-Meteor package with Meteor 1.2.1 and want to import Angular 2 modules. I'm specifically trying to import angular2/http. Would it be proper to use node, atmosphere, typings or

Show Detail