jimpex
    Preparing search index...

    Variable htmlServicesProviderConst

    htmlServicesProvider: {
        htmlGeneratorProvider: ResourceCreator<
            "provider",
            "register",
            (options?: HTMLGeneratorProviderOptions) => (app: Jimpex) => void,
            ProviderRegisterFn<Jimpex>,
        >;
    } & Record<
        string,
        Resource<"provider", "register", ProviderRegisterFn<Jimpex>>,
    > & { provider: true } & { register: ProviderRegisterFn<Jimpex> } & Record<
        string,
        unknown,
    > = ...

    Registers all the HTML services on the container.

    Type Declaration

    • htmlGeneratorProvider: ResourceCreator<
          "provider",
          "register",
          (options?: HTMLGeneratorProviderOptions) => (app: Jimpex) => void,
          ProviderRegisterFn<Jimpex>,
      >

      The service provider that once registered on the container will set an instance of HTMLGenerator as the htmlGenerator service. it will also hook itself to the after-start event of the application in order to trigger the generator of the HTML file.

        // Register it on the container
      container.register(htmlGeneratorProvider);
      // Getting access to the service instance
      const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');
        container.register(
      htmlGeneratorProvider({
      serviceName: 'myHtmlGenerator',
      valuesServiceName: 'myValuesService',
      template: 'my-template.tpl.html',
      }),
      );
    • provider: true
    • register: ProviderRegisterFn<Jimpex>
    // Register the collection on the container
    container.register(htmlServicesProvider);
    // Getting access to one the services instance
    const htmlGenerator = container.get<HTMLGenerator>('htmlGenerator');