Skip to content

Instantly share code, notes, and snippets.

View coskuncakir's full-sized avatar

Coskun Cakir coskuncakir

View GitHub Profile
@coskuncakir
coskuncakir / 1_route.animations.ts
Last active September 12, 2023 13:46
Angular fade animation for transition between routes.
import {
trigger,
animate,
transition,
style,
query
} from '@angular/animations';
export const fadeAnimation = trigger('fadeAnimation', [
transition('* => *', [
@coskuncakir
coskuncakir / safe.pipe.ts
Last active July 7, 2020 17:36
If you are receiving an error like this when you want to show your file on the screen. "Error: unsafe value used in a resource URL context" then you need to sanitize your resource url. here is a pipe that you can use for this purpose.
import { Pipe, PipeTransform } from '@angular/core';
import {
DomSanitizer,
SafeHtml,
SafeStyle,
SafeScript,
SafeUrl,
SafeResourceUrl
} from '@angular/platform-browser';
export enum Currencies {
AED = 'United Arab Emirates Dirham',
AFN = 'Afghanistan Afghani',
ALL = 'Albania Lek',
AMD = 'Armenia Dram',
ANG = 'Netherlands Antilles Guilder',
AOA = 'Angola Kwanza',
ARS = 'Argentina Peso',
AUD = 'Australia Dollar',
AWG = 'Aruba Guilder',
export enum Countries {
AF = 'Afghanistan',
AX = 'AlandIslands',
AL = 'Albania',
DZ = 'Algeria',
AS = 'American Samoa',
AD = 'Andorra',
AO = 'Angola',
AI = 'Anguilla',
AQ = 'Antarctica',
@coskuncakir
coskuncakir / slugify.pipe.ts
Last active May 29, 2023 12:28 — forked from djabif/slugify.pipe.ts
Angular Pipe to transform a string into a slug with turkish character support.
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'slugify' })
export class SlugifyPipe implements PipeTransform {
transform(input: string): string {
const trChars = {
'çÇ': 'c',
'ğĞ': 'g',
'şŞ': 's',
'üÜ': 'u',