python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 7, Interview Questions Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
@NgModule decorator

What are the differences in NgModules and JavaScript Modules?

What are the differences in NgModules and JavaScript Modules?

NgModules vs. JavaScript Modules -
The NgModule is a TypeScript class decorated with @NgModule Decorator - is a fundamental feature of Angular.

JavaScript also has its own module system for managing collections of JavaScript objects. It is completely different from the NgModule system.

In JavaScript, each file is a module and all objects defined in the file belong to that module. The module declares some objects to be public by marking them with the export keyword.

Other JavaScript modules use import statements to access public objects from other modules.

The following is an example of specifying an export and import statements -
export class AppComponent {
   //...
}

After export your class, you can import that file code in another file.
import { AppComponent } from './app.component';


Both the JavaScript and Angular use modules to organize applications code.
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions