Angular 2, import format

34 views
Skip to first unread message

Dawg

unread,
Jun 30, 2016, 8:03:19 AM6/30/16
to AngularJS
Hello,

The different tutorials I looked at has variations in how it imports classes into its components, example:

1 import { Component } from '@angular/core';

2. import {CourseComponent} from './courses.component'

As you can see the first import has the @  sign verses the second line which I understand how it works but bit confused as to the purpose of @ in the first import???




Lucas Lacroix

unread,
Jun 30, 2016, 8:41:21 AM6/30/16
to ang...@googlegroups.com
The "@" is just a part of the package name. There is no special meaning.

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Lucas Lacroix
Computer Scientist
System Technology Division, MEDITECH

Lucas Lacroix

unread,
Jun 30, 2016, 4:59:01 PM6/30/16
to ang...@googlegroups.com

I just learned something new.
The "@" has special meaning to NPM - everything between it and the "/" is the scope. A scope can be a user or organization. It's basically telling you who the owner is.

Still, it has no special meaning to NodeJS or the module systems.

Reply all
Reply to author
Forward
0 new messages