Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Kalpesh300's full-sized avatar
🎯
Focusing

Kalpesh Shingala Kalpesh300

🎯
Focusing
View GitHub Profile
@Kalpesh300
Kalpesh300 / app.component.html
Created December 12, 2019 17:58
Custom Dropdown Control
<app-custom-dropdown [formControl]="dropdownControl"></app-custom-dropdown>
@Kalpesh300
Kalpesh300 / demo.component.ts
Last active March 9, 2020 05:33
Demo Component
import { Component, OnInit, Input } from '@angular/core';
import { Subject } from 'rxjs';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.scss']
})
export class Demo implements OnInit {
@Kalpesh300
Kalpesh300 / demo.component.ts
Last active March 9, 2020 05:30
Demo Component
import { Component, OnInit, Input } from '@angular/core';
import { Subject } from 'rxjs';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.scss']
})
export class Demo implements OnInit {
export enum Status {
Todo = 'todo',
InProgess = 'in-progess',
Done = 'done'
}
import * as routeConstants from 'route.constants.ts';
const routes: Routes = [
{
path: routeConstants.LOGIN_URL,
component: LoginComponent,
},
{
path: routeConstants.REGISTER_URL,
component: RegisterComponent,
// URLS
export const LOGIN_URL = 'login';
export const REGISTER_URL = 'register';
export const FORGOT_PASSWORD = 'forgot-password';
@Kalpesh300
Kalpesh300 / demo.component.ts
Created January 4, 2020 09:39
Demo Component
import { Component, OnInit, Input } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.scss']
})
export class Demo implements OnInit {
@Kalpesh300
Kalpesh300 / demo.component.ts
Last active January 4, 2020 09:20
Demo Component
import { Component, OnInit, Input } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.scss']
})
export class Demo implements OnInit {
@Kalpesh300
Kalpesh300 / custom-dropdown.component.ts
Created December 12, 2019 17:42
Custom Dropdown Component
import { Component, OnInit, forwardRef } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
@Component({
selector: 'app-custom-dropdown',
templateUrl: './custom-dropdown.component.html',
styleUrls: ['./custom-dropdown.component.scss'],
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => CustomDropdownComponent),
@Kalpesh300
Kalpesh300 / custom-dropdown.component.ts
Created December 12, 2019 17:28
Custom Dropdown Component
export class CustomDropdownComponent implements OnInit,
ControlValueAccessor {
options: string[];
selectedOption: string;
onChange: (_: any) => {};
constructor() { }