Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular crud rest api medium

<div class="list row">
  <div class="col-md-8">
    <div class="input-group mb-4">
      <input
        type="text"
        class="form-control"
        placeholder="Search by name"
        [(ngModel)]="name"
      />
      <div class="input-group-append">
        <button
          class="btn btn-outline-secondary"
          type="button"
          (click)="searchByName()"
        >
          Search
        </button>
      </div>
    </div>
  </div>
  <div class="col-md-6">
    <h4>Product List</h4>
    <ul class="list-group">
      <li
        class="list-group-item"
        *ngFor="let product of products; let i = index"
        [class.active]="i == currentIndex"
        (click)="setCurrentProduct(product, i)"
      >
          {{ product.name }}
      </li>
    </ul>

    <button class="m-4 btn btn-sm btn-danger" (click)="deleteAllProducts()">
      Delete All
    </button>
  </div>
  <div class="col-md-6">
    <div *ngIf="currentProduct">
      <h4>Product</h4>
      <div>
        <label><strong>Name:</strong></label> 
      </div>
      <div>
        <label><strong>Description:</strong></label>

      </div>
      <div>
        <label><strong>Status:</strong></label>

      </div>

      <a class="badge badge-warning" routerLink="/products/">
        Edit
      </a>
    </div>

    <div *ngIf="!currentProduct">
      <br />
      <p>Please click on a product</p>
    </div>
  </div>
</div>
Comment

angular crud rest api medium

<div class="list row">
  <div class="col-md-8">
    <div class="input-group mb-4">
      <input
        type="text"
        class="form-control"
        placeholder="Search by name"
        [(ngModel)]="name"
      />
      <div class="input-group-append">
        <button
          class="btn btn-outline-secondary"
          type="button"
          (click)="searchByName()"
        >
          Search
        </button>
      </div>
    </div>
  </div>
  <div class="col-md-6">
    <h4>Product List</h4>
    <ul class="list-group">
      <li
        class="list-group-item"
        *ngFor="let product of products; let i = index"
        [class.active]="i == currentIndex"
        (click)="setCurrentProduct(product, i)"
      >
          {{ product.name }}
      </li>
    </ul>

    <button class="m-4 btn btn-sm btn-danger" (click)="deleteAllProducts()">
      Delete All
    </button>
  </div>
  <div class="col-md-6">
    <div *ngIf="currentProduct">
      <h4>Product</h4>
      <div>
        <label><strong>Name:</strong></label> 
      </div>
      <div>
        <label><strong>Description:</strong></label>

      </div>
      <div>
        <label><strong>Status:</strong></label>

      </div>

      <a class="badge badge-warning" routerLink="/products/">
        Edit
      </a>
    </div>

    <div *ngIf="!currentProduct">
      <br />
      <p>Please click on a product</p>
    </div>
  </div>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: serverless web app with react netlify 
Javascript :: online md5 decrypt 
Javascript :: javascript node retry promise.all 
Javascript :: js array random find 
Javascript :: eslint failed to load react 
Javascript :: get data form and map in react js 
Javascript :: JavaScript URL Parse Seperate Parsing 
Javascript :: Mapping page number to index 
Javascript :: const and let keywords in ES6 
Javascript :: blur area behind an element in react native 
Javascript :: subject in angular service file 
Javascript :: Imports should be sorted alphabetically sort-imports 
Javascript :: find a node that match a spesific selector string in the paren 
Javascript :: Parents, Children & Siblings 
Javascript :: nodejs mongoose connec tion 
Javascript :: react hooks remove item from array 
Javascript :: dollar sign brackets javascript 
Javascript :: x is not a function javascript type error 
Javascript :: @click:append 
Javascript :: 2495016599 
Javascript :: react 5 to 10 rating 
Javascript :: .datepicker make modal exit 
Javascript :: how to angular html ts function 
Javascript :: lieke==1 
Javascript :: Spread Syntax for array literals or strings 
Javascript :: geojson polygon mongoose 
Javascript :: remove undefined from object javascript 
Javascript :: pass image as props vue vuetify 
Javascript :: node.js how to install a custom version of packgage 
Javascript :: UnhandledPromiseRejectionWarning: SequelizeDatabaseError: type "enum" already exists 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =