Skip to content

Instantly share code, notes, and snippets.

View zzpzaf's full-sized avatar

Panos zzpzaf

View GitHub Profile
@zzpzaf
zzpzaf / element-selector-example.ts
Created November 9, 2021 09:43
Angular Directive selectors - Element Selector example
import { Directive } from '@angular/core';
@Directive({
selector: 'elem'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / npmts.sh
Last active November 9, 2021 09:47
MacOS Bash Script to generate a basic Typescript/Node project scaffold
#!/bin/bash
# **************************************************************************************************
# Bash script filename: npmts.sh - version 0.0.1
# ==================================================================================================
# 211021-31 (c) Copyright Panos Zafiropoulos <www.devxperiences.com>
# --------------------------------------------------------------------------------------------------
#
# Description:
# ---------------------------------------------------------------------------------------------------
# Creates a new npm / Typescript project/scaffold inside the current folder it runs
@zzpzaf
zzpzaf / attribute-selector-example.ts
Created November 9, 2021 09:49
Angular Directive selectors - Attribute Selector example
import { Directive } from '@angular/core';
@Directive({
selector: '[myattr]'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / attribute-selector-example2.ts
Created November 9, 2021 09:51
Angular Directive selectors - Attribute Selector example with value
import { Directive } from '@angular/core';
@Directive({
selector: '[myattr=Panos]'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / selector-chaining-example3.ts
Created November 9, 2021 10:00
Angular Directive Selectors - Combinations of selectors – Chaining example using OR / commas
import { Directive } from '@angular/core';
@Directive({
selector: 'elem,[myattr]'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / selector-chaining-example4.ts
Created November 9, 2021 10:00
Angular Directive Selectors - Combinations of selectors – Chaining example using exclusions with not keyword
import { Directive } from '@angular/core';
@Directive({
selector: 'elem:not(.myclass)[myattr]'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / class-selector-example.ts
Last active November 9, 2021 10:05
Angular Directive selectors - Class Selector example
import { Directive } from '@angular/core';
@Directive({
selector: '.myclass'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / selector-chaining-example1.ts
Created November 9, 2021 10:18
Angular Directive Selectors - Combinations of selectors – Chaining example 1
import { Directive } from '@angular/core';
@Directive({
selector: 'elem[myattr]'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / selector-chaining-example2.ts
Created November 9, 2021 10:19
Angular Directive Selectors - Combinations of selectors – Chaining example 2
import { Directive } from '@angular/core';
@Directive({
selector: 'elem.myclass[myattr]'
})
export class MyDirective {
constructor() { }
}
@zzpzaf
zzpzaf / s02.ts
Created November 13, 2021 10:09
First steps in Typescript Array Sorting-s02
var arr = new Array("orange", "mango", "banana", "sugar");
var sorted = arr.sort();