Typescript Interface [Typescript Tutorial]
sensei2017-03-29T06:45:34+00:00An Interface is a description that defines specific methods that implements a class. Again, open your integrated terminal then type ng g interface <interfaceName> An Interface named Security is generated and ready for editing. A sample interface export interface Security { trade(); fairValueCompute(); } To use your interface, first you have to choose a class that will implement your interface. Let’s choose Bonds which we created earlier. import {Security} from './security'; export class Bonds{ constructor(){ } getBonds(){ } } Import our interface named Security import {Security} from './security'; export class Bonds implements Security{ constructor() In the export class of Bonds, [...]