Skip to main content

Posts

Angular NgModules - angular modules simple example - Angular 7-6-5-4-3-2-1-AngularJs

Angular Module In Angular, Modules are the collection of the Components, Service directives, and Pipes which are related such that they can be combined to form a module.   A module is a collection of services, directives, controllers, filters, and configuration information.  angular . module  is used to configure the  What's an NgModule NgModules are simply TypeScript classes decorated with the  @NgModule  decorator imported from the  @angular/core  package. Modules provide a way for developers to organize their code and they are particularly helpful for managing large apps. In Angular, Modules are the collection of the Components, Service directives, and Pipes which are related such that they can be combined to form a module.

Angular project folder file structure

Workspace files The top level of the workspace contains a number of workspace-wide configuration files. WORKSPACE CONFIG FILES PURPOSE .editorconfig Configuration for code editors. See  EditorConfig . .gitignore Specifies intentionally untracked files that  Git  should ignore. angular.json CLI configuration defaults for all projects in the workspace, including configuration options for build, serve, and test tools that the CLI uses, such as  TSLint ,  Karma , and  Protractor . For details, see  Angular Workspace Configuration . node_modules Provides  npm packages  to the entire workspace. package.json Configures  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.json Provides 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  inst

Angular Tutorial - Angular Templating - Angular 7-Angular 8 -Angular 6- Angular Js

Angular 7 Templating You may have noticed that one of the components we generated was called  nav . Let's implement a header bar with a navigation in our app! The first step is to visit the  app.component.html  file and specify the following contents: Angular Tutorial: Learn Angular  Templating  step by step < app-nav > </ app-nav > < section > < router-outlet > </ router-outlet > </ section > So, we've removed a bunch of templating and placed in  <app-nav></app-nav> , what does this do and where does it come from? Well, if you visit  /src/app/nav/nav.component.ts  you will see that in the component decorator, there's a  selector  property bound to the value of  app-nav . When you reference the selector of a given component in the form of a custom HTML element, it will nest that component inside of the component it's that's referencing it. If you save the file you just updated, you will s

Angular Tutorial - Angular Components - Angular 7-Angular 8 -Angular 6- Angular Js

Learn Angular from scratch step by step Angular 7 Components - Angular 8 The most basic building block of your Angular 7 application (and this is a concept that's not new) is the component. A component consists of three primary elements: The HTML template The logic The styling (CSS, Sass, Stylus, etc..) When we use the Angular CLI to start a new project, it generates a single component, which is found in  /src/app/ : /app.component.html /app.component.scss /app.component.ts While we have three files here that represent the three elements above, the  .ts  (TypeScript) is the heart of the component. Let's take a look at that file: import { Component } from '@angular/core' ; @ Component ( { selector : 'app-root' , templateUrl : './app.component.html' , styleUrls : [ './app.component.scss' ] } ) export class AppComponent { title = 'ng7-pre' ; } Here, because this is a component, we're im

Angular 7 Tutorial - Learn Angular 7 by Example - Installation of Angular

Angular Tutorial: Learn Angular step by step Installation of Angular 7 You're first going to need to install the Angular CLI (Command Line Interface) tool, which helps you start new Angular 7 projects as well as assist you during development. In order to install the Angular CLI, you will need  Nodejs . Make sure you install this with the default options and reload your command line or console after doing so. In your command line, type: > npm install -g @angular/cli Once complete, you can now access the CLI by simply starting any commands with  ng . Hop into whichever folder you want to store your projects, and run the following command to install a new Angular 7 project: > ng new Angular7Example It's going to present you with a couple questions before beginning: ? Would you like to add Angular routing? Yes ? Which stylesheet format would you like to use? SCSS [ http :// sass - lang . com ] It will take a minute or two and once completed, you can no