Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export interface ICao {
  2.     ladrar(): void;
  3. }
  4. export class Cao {
  5.     private listener: ICao;
  6.     constructor() {
  7.  
  8.     }
  9.  
  10.     public bindInterface(icao: Icao): void {
  11.         this.listener = icao;
  12.     }
  13.  
  14.     private pontapeNoCao(): void {
  15.         this.listener.ladrar();
  16.     }
  17. }
  18.  
  19.  
  20. export testeDrive implements Icao {
  21.     private cao: Cao;
  22.     constructor() {
  23.  
  24.     }
  25.  
  26.     private init(): void {
  27.         this.cao = new Cao();
  28.         this.cao.bindInterface(this);
  29.     }
  30.  
  31.     ladrar(): void {
  32.         console.log('o cao ladrou');
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement