-
Notifications
You must be signed in to change notification settings - Fork 175
3. SDK Components
When generating your SDK; The LoopBack SDK Builder will create a SIM set for each Model you have defined in your LoopBack Application.
Services are regular Angular 2 @Injectable()
Services that allows you to interact with your API either through standard RESTful communication, WebSockets or even Server Sent Events. Real-time with no excuses.
Will declare all of the model properties defined in your LoopBack Application, it will even set these as optional or required according your model configuration.
Models are regular classes that will implement the model Interface and a constructor that allows to extend models to provide custom functionality.
Models and Interfaces are a set of TypeScript Declaration Files.
While generating your SDK; the LoopBack SDK Builder will create each of these components for each Model you have defined in your LoopBack Application.
- Services.- Adds an
Api
postfix to the Model name. - Interfaces.- Adds an
Interface
postfix to the Model name. - Model.- Is just the Model name.
The LoggerService is a tool that wraps the console
methods (log, info, warn, error, count, group, profile, etc.) but allowing you to disable/enable your logs for development/production mode.
import { LoopBackConfig, LoggerService } from './shared/sdk';
...
class MyComponent {
constructor(private log: LoggerService) {
LoopBackConfig.setDebugMode(false); // defaults true
this.log.info('Component is Loaded');
}
}