Skip to content

Instantly share code, notes, and snippets.

View palanisamym14's full-sized avatar

palanisamym14

View GitHub Profile
@palanisamym14
palanisamym14 / service.js
Created December 2, 2018 18:08 — forked from paulsturgess/service.js
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}
public searchOption = {'searchFeild': 'tag', 'orderByKey': 'isActive', 'orderBy': 'asc'};
import { Pipe, PipeTransform } from '@angular/core';
export interface SearchOption {
searchFeild: string; // Search By specific object keyName
orderByKey: string; // Order By specific object key
orderBy: string; // OrderBy asc/desc
}
@Pipe({
name: 'searchfilter'
let query = 'select * from data where id=:id and test=:test';
let data = {
id:1,
test:11,
}
let data1 = {
id:1
}
export const ValidateSchema = (values, schema) => {
return new Promise((resolve, reject) => {
const { value, error } = schema.validate(values);
const valid = error == null;
if (valid) {
resolve(value);
} else {
const { details } = error;
const message = details.map((i) => i.message).join(",");
reject(message);
import { SettingOutlined, UserAddOutlined } from '@ant-design/icons';
export const menuItems = () => [
{
menuId: 'training',
label: 'Trainings',
routePath: '',
icon: SettingOutlined,
subMenu: [
{
<link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap&subset=latin-ext" rel="stylesheet">
public formatDate() {
return moment.utc(new Date().toISOString().replace(/T/, ' ').slice(0, -1)).format('YYYY-MM-DD HH:mm:ss.SSS');
}
const query :any= 'select a, b.d,ROW_NUMBER() OVER(ORDER BY col DESC),b.e as f,c as g from const';
const test = (query:any, offset:any,limit:any)=>{
let data:any = query.split('from')[0];
data = data.split('FROM')[0];
let tempQuery:any = data.split(',');
let queryt:any = `${tempQuery[0]}`;
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript"]
}
.select-style {
padding: 0;
margin: 0;
border: 1px solid #ccc;
width: 120px;
border-radius: 3px;
overflow: hidden;
background-color: #fff;
background-size:10px 10px;
background: #fff url("https://image.flaticon.com/icons/svg/892/892498.svg") no-repeat 40% 50%;