Manual Component
This page summarizes the information & use of manual components.
Concepts
Usage
import { Configuration, Injectable, Component } from "https://deno.land/x/mandarinets/mod.ts";
export class ManualInjectionService {
public name: string;
constructor(name: string) {
this.name = name;
}
public helloWorld(): string {
return `Hello ${this.name}`;
}
}
@Configuration()
export class MainConfig {
@Injectable()
public ManualInjectionService() {
return new ManualInjectionService("Bill");
}
}
@Component()
export class MyComponent {
@Inject()
public service: ManualInjectionService;
public getResult(): string {
return this.service.helloWorld();
}
}Last updated