Skip to content

Instantly share code, notes, and snippets.

View msarsha's full-sized avatar
🏠
Working from home

Matan Sar-Shalom msarsha

🏠
Working from home
View GitHub Profile
export const LOGIC_HANDLER = new InjectionToken<CaseLogicHandler>('logic.handlers');
export interface CaseLogicHandler {
key: any;
doLogic();
}
@msarsha
msarsha / caseClass.ts
Created February 22, 2018 21:12
switch\case angular di
export class CaseOne implements CaseLogicHandler{
key: any = 1;
doLogic() {
// case logic
}
}
export class CaseTwo implements CaseLogicHandler{
key: any = 2;
doLogic() {
@msarsha
msarsha / myDir.ts
Last active February 18, 2018 10:20
myDir
@Directive({
selector: '[myDir]'
})
export class MyDirDirective {
constructor(public template: TemplateRef<any>) {
}
}
@msarsha
msarsha / component.ts
Last active December 23, 2017 10:24
angular popover api
@Component({
template:`
<div popover="popoverOne">
// content
</div>
<div popover="popoverTwo">
// content