How to install Angular Framework

0

Angular Framework Installation



Step 1st:-


Download node package manager using http://nodejs.org

install a node package manager, after successful installation of node check node version


open command prompt node -v


step2nd:-

Install Angular Framework using npm install -g @angular/cli@latest


Step3rd:-

check the angular version using ng --version

step4th:-

create application using
ng new applicationnane

step5th:-

ng serve

step6th:-

Create Component

ng generate component componentname

ng g c componentname




Code of app.component.ts

import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [AppComponent],
    }).compileComponents();
  });

  it('should create the app', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app).toBeTruthy();
  });

  it(`should have the 'my-app' title`, () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.componentInstance;
    expect(app.title).toEqual('my-app');
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.nativeElement as HTMLElement;
    expect(compiled.querySelector('h1')?.textContent).toContain('Hello, my-app');
  });
});


code of appcomponent.html



<main class="main">
  <div class="content">
   
    <div class="divider" role="separator" aria-label="Divider"></div>
    <div class="right-side">
       <h1>Welcome in Angular JS Framework</h1>
       {{s}}
       {{fun()}}
    </div>
  </div>
</main>


<router-outlet></router-outlet>


Create an Angular Tour App:-  https://angular.io/tutorial/toh-pt4

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)