kmg
kmg

Reputation: 1385

Where is the entry point specified in angular application

I'm new in angular and got sample angular application installed using angular-cli. This has package.json file, which must usually have the entry point of that application. But I didnt find that being defined in this pre-defined pakage.json file. Where does the entry point of angular app gets specified in this and why not in package.json file as expected.

Upvotes: 7

Views: 24246

Answers (4)

Vivek Nuna
Vivek Nuna

Reputation: 1

As righlty mentioned in the other answers, the below line is the entry point of the Angular application.

platformBrowserDynamic().bootstrapModule(AppModule)

and If you see AppModule, It has a line bootstrap: [AppComponent] which tells us the bootstrapping component is the AppComponent

Upvotes: 0

AFSHAN
AFSHAN

Reputation: 51

main.ts >> app.Module.ts >> app.component.ts >> index.html >> app.component.html

is the starting point in angular app You can refer here.

Upvotes: 5

TheParam
TheParam

Reputation: 10541

Angular and node.js are different altogether. Angular has is own way managing project structure

When Angular project is loaded ... it bootstraps the module defined in main.ts ... which is your AppModule.

platformBrowserDynamic().bootstrapModule(AppModule);

Also, note that you are working with TypeScript files. Those files are transpiled to JavaScript and then compiled by the Angular compiler.

Upvotes: 2

Julien Ambos
Julien Ambos

Reputation: 2088

Angular does not provide an entry point similar to node.js, but rather a compiled application (a bunch of .js files, .css files, assets and an index.html file). The application can be run by opening the index.html file.

What parts of the application will be compiled is being determined by your main.ts file, and mostly the line

platformBrowserDynamic().bootstrapModule(AppModule)

which defines the AppModule to be the "entry point" of your application.

It is the "root" module that you bootstrap to launch the application

Please see this documentation for further details.

Upvotes: 12

Related Questions