Open thejhh opened 1 year ago
@Autowired Annotation: By employing this annotation, parameters, properties, and setters will be automatically wired based on their types. This will simplify dependency injection and improve code modularity.
@Autowired Annotation
export class NorAgentApp { @useAutowired() public static async run ( @autowired('args') args: readonly string[], @autowired('stateService') stateService ?: AgentStateService, @autowired('parsedArgs') parsedArgs ?: ParsedCommandArgumentObject, @autowired('destroyService') destroyService ?: DestroyService, ): Promise<CommandExitStatus> { console.log('Hello World'); } }
AutowireUtils
This is not perfect but step forward.
@Autowired Annotation
: By employing this annotation, parameters, properties, and setters will be automatically wired based on their types. This will simplify dependency injection and improve code modularity.Example
TODO
AutowireUtils
For further insights and references, please refer to the following resources: