Jump to content

Angular TypeScript sahayamu


Recommended Posts

Posted
5 minutes ago, usauae said:

super bro stackblitz lo work avutundi, but not on my page. may be because there are more than one list on the page.

chustunna easy ga yemi aina fix cheyavachhu yemo ani

 

Inka easy cheyachu, to give solution superfast... I did best of best

Posted
36 minutes ago, kittaya said:

Inka easy cheyachu, to give solution superfast... I did best of best

any help on this error bro ?

myTypes: MyType[] = [];

Property 'scrollIntoView' does not exist on type 'MyType'.

Posted
1 minute ago, usauae said:

any help on this error bro ?

myTypes: MyType[] = [];

Property 'scrollIntoView' does not exist on type 'MyType'.

just filter the list using observable or use pipes to retain

 

 

 

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'SearchPipe',
    pure: false
})
export class SearchPipe implements PipeTransform {
    transform(items: any[], filter: any): any {
        if (!items || !filter) {
            return items;
        }
        // filter items array, items which match and return true will be
        // kept, false will be filtered out
      return items.filter(item => item.StrValue.toLowerCase().indexOf(filter.toLowerCase())>-1);
    }
}

 

*ngFor="let name of SearchResult | SearchPipe:searchword;let i=index"

 

 

Posted
34 minutes ago, Kootami said:

just filter the list using observable or use pipes to retain

 

 

 

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'SearchPipe',
    pure: false
})
export class SearchPipe implements PipeTransform {
    transform(items: any[], filter: any): any {
        if (!items || !filter) {
            return items;
        }
        // filter items array, items which match and return true will be
        // kept, false will be filtered out
      return items.filter(item => item.StrValue.toLowerCase().indexOf(filter.toLowerCase())>-1);
    }
}

 

*ngFor="let name of SearchResult | SearchPipe:searchword;let i=index"

 

 

sorry bro mukka ardam kaaledu

yemi anukoku

Posted

Included Players

G

H

I

J

K

L

M

Btn Include <

Btn Exclude >

Excluded Players

A

B

C

D

E

F

N

Posted

basically naa ui ila vundi bro same list on both sides but I need to move the liste items to either include or exclude list.

 

Posted
10 hours ago, kittaya said:
import { Component } from '@angular/core';
import { fromEvent } from 'rxjs';
 
@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  name = 'Angular';
 
  itemsany[] = [
    {
      name: 'A Sachin'
    },
    {
      name: 'B Sachin'
    },
    {
      name: 'C Sachin'
    },
    {
      name: 'D Sachin'
    },
    {
      name: 'E Sachin'
    },
    {
      name: 'F Sachin'
    },
    {
      name: 'G Sachin'
    },
    {
      name: 'H Sachin'
    },
    {
      name: 'I Sachin'
    },
    {
      name: 'J Sachin'
    },
    {
      name: 'K Sachin'
    },
    {
      name: 'L Sachin'
    }
  ];
 
  idList = [];
 
  getId(vali) {
    this.idList.push(val.split(' ')[0] + i);
    return val.split(' ')[0];
  }
 
  getrespectiveId(key) {
    return this.idList[
      this.idList.findIndex(
        val => val.split('')[0].toLowerCase() == key.toLowerCase()
      )
    ];
  }
 
  constructor() {
    fromEvent(window'keydown').subscribe((eventKeyboardEvent=> {
      console.log(event.key);
      console.log(this.getrespectiveId(event.key));
      document.getElementById(this.getrespectiveId(event.key)).scrollIntoView({
        behavior: 'smooth'
      });
    });
  }
}

Yee code PR ke submit cheste ofc ninche bayataku 10gaa mantaru. Functional programming ledu dom manipulations Constructor lo. Malli angular use chesta. 

Naku weekend evu. I will show the right way.

Posted
11 hours ago, kittaya said:

knchm jquery vaadu broo... 

 

window keyup event listen cheyyali 

hostlisner all the time

then fire event 

use jquery or javascript to move specific ID 

 

Jquery Sanka naki poye 10 yellow avutunde. Eppudu nevu jquery use cheste nevu ave potavu.

Posted
11 hours ago, kittaya said:

Inka easy cheyachu, to give solution superfast... I did best of best

 

47 minutes ago, HtmlBro said:

Yee code PR ke submit cheste ofc ninche bayataku 10gaa mantaru. Functional programming ledu dom manipulations Constructor lo. Malli angular use chesta. 

Naku weekend evu. I will show the right way.

 

Posted
47 minutes ago, HtmlBro said:

Yee code PR ke submit cheste ofc ninche bayataku 10gaa mantaru. Functional programming ledu dom manipulations Constructor lo. Malli angular use chesta. 

Naku weekend evu. I will show the right way.

Agreed 👍 take your time and post it

Posted
9 hours ago, usauae said:

basically naa ui ila vundi bro same list on both sides but I need to move the liste items to either include or exclude list.

 

Event fire ayyaka... You do whatever you want... You got the choice... Here trick is catching event and scroll.

 

 And next is usual basic code ae ga

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...