Skip to content

Instantly share code, notes, and snippets.

View harishrathi's full-sized avatar

Harish Rathi harishrathi

  • AlgoSys Tech
  • Pune
View GitHub Profile
import { TestBed } from '@angular/core/testing';
import { AllocationRoutingService } from './allocation-routing.service';
describe('AllocationRoutingService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: AllocationRoutingService = TestBed.get(AllocationRoutingService);
expect(service).toBeTruthy();
@harishrathi
harishrathi / dashboard.html
Last active July 3, 2019 07:13
angular-file-upload-control
<form [formGroup]="form">
<formly-form [model]="model" [fields]="fields" [form]="form"></formly-form>
</form>
<pre>{{model | json}}</pre>
<pre>invalid: {{form.invalid}}</pre>
<pre>errors: {{form.errors | json}}</pre>
https://stackblitz.com/edit/ngx-formly-flex-layout
https://stackblitz.com/edit/ngx-formly-flex-layout-ntx9fe
@harishrathi
harishrathi / date-fns-date-adapter.ts
Last active August 7, 2019 07:47 — forked from JoniJnm/date-fns-date-adapter.ts
date-fns angular material adapter
import { Injectable } from '@angular/core';
import { DateAdapter } from '@angular/material';
import { addDays, addMonths, addYears, getDate, getDaysInMonth, getMonth, getYear } from 'date-fns';
import { format, parse, setDay, setMonth, toDate, Locale } from 'date-fns';
import { enUS } from 'date-fns/locale';
export const MAT_DATE_FNS_DATE_FORMATS = {
parse: {
dateInput: 'yyyy-MM-dd',
},
@harishrathi
harishrathi / custom-date-adapater.ts
Created August 7, 2019 07:48
custom-date-adapater.ts
import { Injectable } from '@angular/core';
import { NativeDateAdapter } from '@angular/material';
import { format as formatFns } from 'date-fns';
// https://github.com/angular/components/blob/9eeb4b5aa0473c0815a73bfe3c2ed6164d86a3b3/src/material/core/datetime/native-date-formats.ts
// https://github.com/angular/components/blob/fde980c8ad57a803c7bf6ca0d909cedccc354f06/src/material/core/datetime/native-date-adapter.ts
export const MAT_CUSTOM_DATE_FORMATS = {
parse: {
dateInput: 'yyyy-MM-dd',
},
@harishrathi
harishrathi / angular-configurator.cs
Created April 25, 2020 14:34
dotnet core - angular - npm start
var solutionDir = Directory.GetParent(env.ContentRootPath).FullName;
spa.Options.SourcePath = Path.Join(solutionDir, "ICollect.Public.ClientApp");
spa.UseAngularCliServer("start");