Skip to main content

Angular project folder file structure

Workspace files

The top level of the workspace contains a number of workspace-wide configuration files.
WORKSPACE CONFIG FILESPURPOSE
.editorconfigConfiguration for code editors. See EditorConfig.
.gitignoreSpecifies intentionally untracked files that Git should ignore.
angular.jsonCLI configuration defaults for all projects in the workspace, including configuration options for build, serve, and test tools that the CLI uses, such as TSLintKarma, and Protractor. For details, see Angular Workspace Configuration.
node_modulesProvides npm packages to the entire workspace.
package.jsonConfigures npm package dependencies that are available to all projects in the workspace. See npm documentation for the specific format and contents of this file.
package-lock.jsonProvides version information for all packages installed into node_modules by the npm client. See npm documentation for details. If you use the yarn client, this file will be yarn.lock instead.
tsconfig.jsonDefault TypeScript configuration for apps in the workspace, including TypeScript and Angular template compiler options. See TypeScript Configuration.
tslint.jsonDefault TSLint configuration for apps in the workspace.
README.mdIntroductory documentation.
All projects within a workspace share a CLI configuration context. Project-specific TypeScript configuration files inherit from the workspace-wide tsconfig.*.json, and app-specific TSLint configuration files inherit from the workspace-wide tslint.json.

Default app project files

The CLI command ng new my-app creates a workspace folder named "my-app" and generates a new app skeleton. This initial app is the default app for CLI commands (unless you change the default after creating additional apps).
A newly generated app contains the source files for a root module, with a root component and template. When the workspace file structure is in place, you can use the ng generate command on the command line to add functionality and data to the initial app.
Besides using the CLI on the command line, you can also use an interactive development environment like Angular Console, or manipulate files directly in the app's source folder and configuration files.
The src/ subfolder contains the source files (app logic, data, and assets), along with configuration files for the initial app. Workspace-wide node_modules dependencies are visible to this project.
APP SOURCE & CONFIG FILESPURPOSE
app/Contains the component files in which your app logic and data are defined. See details in App source folder below.
assets/Contains image files and other asset files to be copied as-is when you build your application.
environments/Contains build configuration options for particular target environments. By default there is an unnamed standard development environment and a production ("prod") environment. You can define additional target environment configurations.
browserslistConfigures sharing of target browsers and Node.js versions among various front-end tools. See Browserslist on GitHub for more information.
favicon.icoAn icon to use for this app in the bookmark bar.
index.htmlThe main HTML page that is served when someone visits your site. The CLI automatically adds all JavaScript and CSS files when building your app, so you typically don't need to add any <script>or<link> tags here manually.
main.tsThe main entry point for your app. Compiles the application with the JIT compiler and bootstraps the application's root module (AppModule) to run in the browser. You can also use the AOT compiler without changing any code by appending the --aot flag to the CLI build and serve commands.
polyfills.tsProvides polyfill scripts for browser support.
styles.sassLists CSS files that supply styles for a project. The extension reflects the style preprocessor you have configured for the project.
test.tsThe main entry point for your unit tests, with some Angular-specific configuration. You don't typically need to edit this file.
tsconfig.app.jsonInherits from the workspace-wide tsconfig.json file.
tsconfig.spec.jsonInherits from the workspace-wide tsconfig.json file.
tslint.jsonInherits from the workspace-wide tslint.json file.

Default app project e2e files

An e2e/ subfolder contains configuration and source files for a set of end-to-end tests that correspond to the initial app. Workspace-wide node_modules dependencies are visible to this project.
my-app/
  e2e/                  (end-to-end test app for my-app)
    src/                (app source files)
    protractor.conf.js  (test-tool config)
    tsconfig.e2e.json   (TypeScript config inherits from workspace tsconfig.json)

Project folders for additional apps and libraries

When you generate new projects in a workspace, the CLI creates a new workspace/projects folder, and adds the generated files there.
When you generate an app (ng generate application my-other-app), the CLI adds folders under projects/ for both the app and its corresponding end-to-end tests. Newly generated libraries are also added under projects/.
my-app/
  ...
  projects/           (additional apps and libs)
    my-other-app/     (a second app)
      src/
      (config files)
    my-other-app-e2e/  (corresponding test app) 
      src/
      (config files)
    my-lib/            (a generated library)
      (config files)

App source folder

Inside the src/ folder, the app/ folder contains your app's logic and data. Angular components, templates, and styles go here. An assets/subfolder contains images and anything else your app needs. Files at the top level of src/ support testing and running your app.
APP SOURCE FILESPURPOSE
app/app.component.tsDefines the logic for the app's root component, named AppComponent. The view associated with this root component becomes the root of the view hierarchy as you add components and services to your app.
app/app.component.htmlDefines the HTML template associated with the root AppComponent.
app/app.component.cssDefines the base CSS stylesheet for the root AppComponent.
app/app.component.spec.tsDefines a unit test for the root AppComponent.
app/app.module.tsDefines the root module, named AppModule, that tells Angular how to assemble the application. Initially declares only the AppComponent. As you add more components to the app, they must be declared here.
assets/*Contains image files and other asset files to be copied as-is when you build your application.

Comments

Popular posts from this blog

Asp.net grid CRUD with ADO.NET

Asp.net grid CRUD with ADO.NET A GridView is a graphical control element that presents a tabular view of data. A typical Grid View also supports some or all of the following: Clicking a column header to change the sort order of the Grid. Dragging column headers to change their size and their order. The GridView control displays the values of a data source in a table. Each column represents a field, while each row represents a record. Support to data source controls, such as SqlDataSource. Support sort capabilities. Support update and delete capabilities. Support paging capabilities. Support row selection capabilities. Code behind feature access to the GridView object model to dynamically set properties, handle events, and so on. Many key fields. Many data fields for the hyperlink columns. Customized style layout through themes and styles using css and javascript. The following operations can be performed using GridView control in ASP.NET using C# code behind. Fea

MVC Action Filters using log4net

Add log4net dll reference to your MVC project ------------------------------------------------------------------------------ Create following  model inside your models folder ------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Web; using System.Web.Mvc; namespace MVCWebApp.Models {     public class LoggingFilterAttribute : ActionFilterAttribute     {         #region Logging         /// <summary>         /// Access to the log4Net logging object         /// </summary>         protected static readonly log4net.ILog log =           log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);         private const string StopwatchKey = "DebugLoggingStopWatch";         #endregion         public override void OnActionExecuting(ActionExecutingContext filterContext)

Cascading Dropdown in Angular 7

Cascading Dropdown in Angular 7 And Web API Prerequisite Angular 7  Web API HTML/Bootstrap SQL Server Cascading DropDownList means a series of dependent DropDownLists where one DropDownList is dependent on another DropDownList. Child DropDownLists are populated based on the item selected in dropdownlist by a user. For example, loading all states in a country. There are three parts of this article. Create a SQL Server database with two tables, parent and child.  Create a Web API using ASP.NET Web API Project template Create an Angular 7  app Part 1. Create a Database For this article, I have created a database and two tables. If you already have data representing a parent-children form, you may skip this step. Step 1.  Open SQL Server Management Studio, connect to a server, and get ready to execute SQL.  Step 2. Create a database using the following query. create   Database  CaseCaddingDDL   Step 3.  Create a table, CountryMaster, usin