Skip to content

Instantly share code, notes, and snippets.

View rakshitshah94's full-sized avatar
💭
If I can't, who else will ?

RAKSHIT SHAH rakshitshah94

💭
If I can't, who else will ?
View GitHub Profile
@rakshitshah94
rakshitshah94 / iso-country-codes.txt
Created October 15, 2021 09:53
Gist for global ISO country codes
Country list chart prepared by Author: Rakshit Shah (Github/Rakshitshah94)
+-----------------------------------+-----------------------+-------------------------------+-----------------------+
| Country Name | ISO Country Code | Country Name | ISO Country Code |
+-----------------------------------+-----------------------+-------------------------------+-----------------------+
| AF Afghanistan | AF | AL Albania | AL |
| DZ Algeria | DZ | AD Andorra | AD |
| AO Angola | AO | AG Antigua and Barbuda | AG |
| AR Argentina | AR | AM Armenia | AM |
| AU Australia | AU | AT Austria | AT |
| AZ Azerb
@rakshitshah94
rakshitshah94 / app.module.ts
Created September 5, 2021 17:21
Detect internet status online offline angular demo - beingcoders
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { OnlineStatusModule } from 'ngx-online-status';
@NgModule({
imports: [
BrowserModule,
FormsModule,
@rakshitshah94
rakshitshah94 / app.component.ts
Created September 5, 2021 17:20
Detect internet status online offline demo - angular - beingcoders
import { Component } from '@angular/core';
import { OnlineStatusService, OnlineStatusType } from 'ngx-online-status';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
status: OnlineStatusType; //Enum provided by ngx-online-status
@rakshitshah94
rakshitshah94 / app.component.html
Created September 5, 2021 17:18
Detect Internet Status Online Offline Demo - Angular - BeingCoders
<div
class="status"
[class.offline]="status === onlineStatusCheck.OFFLINE"
></div>
<div style="text-align:center">
<h1>
Detect Internet Status Online Offline Demo
</h1>
<h2>
@rakshitshah94
rakshitshah94 / app.component.html
Created September 5, 2021 10:56
Kendo grid groupable columns with checkbox demo - angular - beingcoders
<kendo-grid [data]="gridData" [pageSize]="state.take" [skip]="state.skip" [sort]="state.sort" [group]="state.group"
[sortable]="{ mode: 'multiple' }" [pageable]="true" [groupable]="{ showFooter: true }"
(dataStateChange)="dataStateChange($event)">
<kendo-grid-column field="Order_id" title="Product ID" width="150">
<ng-template kendoGridHeaderTemplate>
<input
type="checkbox"
(change)="checkGroup(group)"
class="k-checkbox"
id="selectAllCheckboxPrintId"
@rakshitshah94
rakshitshah94 / app.component.ts
Last active September 5, 2021 10:52
Kendo Grid Groupable Demo - BeingCoders
import { Component, ViewChildren, QueryList } from '@angular/core';
import { DataStateChangeEvent } from '@progress/kendo-angular-grid';
import { GroupResult, process, State } from '@progress/kendo-data-query';
export class pro {
Order_id: boolean = true;
ProductName: boolean = false;
constructor() {
//Object.assign(this,values); //if requres
}
}
@rakshitshah94
rakshitshah94 / angular.component.ts
Last active May 1, 2021 08:47
Services for any Side Effects.It is a good place for any HTTP requests, event handlers, time-based events. It reduces the complexity of the component and provides reusability to our codebase.
@Injectable({
providedIn: 'root'
})
export class UsersService {
constructor (private http: HttpClient) {}
getUsers() {
return this.http.get(API_ENDPOINT);
}
@rakshitshah94
rakshitshah94 / CDK Virtual Scroll
Created May 1, 2021 08:27
Use a virtualized scroll list like e.g. CDK Virtual Scroll when you need to display a very large records collection. It will render just items that fit within ViewPort in the current scroll position, in comparison to rendering all items at once without virtualization.
import { ScrollingModule } from '@angular/cdk/scrolling';
@NgModule({
...,
imports: [
...,
ScrollingModule
],
@rakshitshah94
rakshitshah94 / trackBy in ngFor
Created May 1, 2021 08:26
Use trackBy in ngFor loops to optimize the re-rendering of iterable.trackByFn is a function that defines how to track changes for items in the iterable. When items are added, moved, or removed in the iterable, only those nodes that have changed are re-rendered.
@Component({
template: `
{{item.id}}
`,
})
export class SampleComponent {
constructor() {
this.items = [
@rakshitshah94
rakshitshah94 / Routings in Angular
Created May 1, 2021 08:21
Keep route names as const. It will prevent accidental typos.
export class ROUTE {
public static readonly LOGIN = '/login';
public static readonly RECRUITMENTS = '/recruitments';
public static readonly RECRUITMENT_EDIT = '/recruitments/:id';
}