December 2017
Beginner
372 pages
10h 32m
English
Our code in the current shape does not expose the class or interface to outside the module. We can continue to reference them inside the service.ts file, as follows:
interface iBoardService{ url:string; getBoardInformation();}class BoardService{ url:string; getBoardInformation(){ return "No boards available"; }}let boardService = new BoardService();boardService.getBoardInformation();
We are able to create an instance of the BoardService class and call its methods. However, if we try to do the same in another file, we will get an error.
To be able to expose the members of the module, we should use the export keyword. The export keyword behaves similarly as in the case of namespace. It allows us to explicitly define which ...
Read now
Unlock full access