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
@angular/core/global. Exposes a set of functions in the global namespace which are useful for debugging the current state of your application. These functions are exposed via the global ng "namespace" variable automatically when you import from @angular/core and run your application in development mode.
CoreModule should have only services and be imported only once in the AppModule . SharedModule should have anything but services and be imported in all modules that need the shared stuff (which could also be the AppModule ).
It's just the name of the import. It doesn't have a special meaning. – VLAZ. Jul 29, 2021 at 8:41.
To solve the error "Cannot find module '@angular/core'", make sure you have installed all dependencies by running the npm install command, set the baseUrl option to src in your tsconfig. json file and restart your IDE and development server.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With