Skip to content

Instantly share code, notes, and snippets.

@danivicario
Created February 21, 2018 23:57
Show Gist options
  • Save danivicario/0c3fb38dea02196e7cfbed65d336c751 to your computer and use it in GitHub Desktop.
Save danivicario/0c3fb38dea02196e7cfbed65d336c751 to your computer and use it in GitHub Desktop.
For Mike
import { Component } from '@angular/core';
interface Employee {
name: string;
salary: number;
}
interface Test {
a: number;
b: Employee;
}
type ttt = (a: number, b: number) => number;
type Fun = (a: number, b: Employee) => string;
const f2: ttt = (a, b) => {
return a + b;
};
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title;
constructor() {
this.title = f2(3, 25);
}
test: Test = {
a: 4,
b: {
name: 'dani',
salary: 1000
}
};
f: Fun = (a: number, b2: Employee) => {
return 'a + b2';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment