18

Might be very stupid but I have seen several uses of

import {Component} from 'angular2/core'

and

import {Component} from '@angular/core'

but I am not able to understand when to use one or another.

Thanks

0

3 Answers 3

12

Since the first release candidate the packages are repackaging into individual packages. There is now one package for each feature area.

angular2/core (before rc.0) -> @angular/core (>= rc.0) 
Sign up to request clarification or add additional context in comments.

Comments

6

Angular2 team has repackaged Angular and all those packages are distributed under @Angular npm scope.

Read here more from official docs and check various changed paths with RC relase, https://github.com/angular/angular/blob/master/CHANGELOG.md (2.0.0-rc.0 (2016-05-02))

# When Angular2 was going through Beta Releases, we used import various symbols from angular2/core.

# Now Angular2 is going through Release candidate(RC), we have to import various symbols from @angular/core.

Comments

2

import {Component} from 'angular2/core' for versions <= beta.x

import {Component} from '@angular/core' for >= RC.x

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.