• Angular

    Angular Error:

    Property ‘http’ does not exist on type

    Checklist-

    • import { HttpClient } from ‘@angular/common/http’; import is must in http
    •  constructor( private http: HttpClient
    • now you can use http in rest of component class
  • Angular

    Can’t bind to ‘ngmodel’ since it isn’t a known property of ‘input’. angular 8

    Error in angular at console gives

    can’t bind to ‘ngmodel’ since it isn’t a known property of ‘input’. angular 8

    in xyz.component .html code must be like

    <div  class="form-group">
        <div class="form-group">
            <label>Name of Category</label>
            <input type="text" name="category"  class="form-control" [(ngModel)]="category">
        </div>
    
        <div class="form-group">
            <label>Category Detail</label>
            <textarea name="category_detail"  class="form-control" [(ngModel)]="category_detail"></textarea>
        </div>
        <button class="btn btn-primary" (click)="onAddCategory()">Add Category</button>
    </div>

    mind the code : [(ngModel)]=”category”

    In app.module.ts

    there must be added FormsModule.

    import { FormsModule } from ‘@angular/forms’;

    imports: [ FormsModule]

  • Angular

    Initial Angular Basic Comands

    The initial Angular how to points to remember.


    How to create new workspace in angular ?

    *** angular project with folder / project name nameofproject

    ng new nameofproject

    this will be done after installing node in your system , and in command prompt(CMD ) getting to the folder where you want to install angular.

    How to start angular project ?

    *** component for a specific part work

    go to CMD editor , type the path where file exists and type command

    ng serve

    ** like c:/abc/nameofproject its the path now you will write ng serve.

    How to create new component in angular ?

    *** component for a specific part work

    ng generate component thename

    or

    ng g c thename

    or

    ng g component thename

    ** thename here is any name you want the component name to be made.
    if within a folder the type ng g c foldername/ cname