February 2019
Beginner
694 pages
18h 4m
English
Now that we are injecting property functions through our ConstructorInjector decorator, we can use our dependency injector framework as follows:
import GMailServiceDi from './app/GMailServiceDi';
import { ServiceLocatorGeneric } from './app/ServiceLocator';
import { IISystemSettings } from './app/ISystemSettings';
ServiceLocatorGeneric.register(IISystemSettings, {
SmtpServerConnectionString : 'smtp://localhost:1025',
SmtpFromAddress : 'smtp_from@test.com'
});
var gmailDi = new GMailServiceDi();
gmailDi.sendMail("test@test.com", "testsubject", "testContent"
).then( (msg) => {
console.log(`sendMail returned : ${msg}`);
} ).catch( (err) => {
console.log(`sendMail returned : ${err}`);
});
After importing the various ...
Read now
Unlock full access