An 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
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 our interface named Security
In the export class of Bonds, add implements Security. If you’ll notice, Bonds has two errors.
It says that property trade and fairValueCompute is missing in the type Bonds. What you need to do is add those into the Bonds class.
The error should be resolved and you should now be able to save your work.