Miniprogram Feature

Service

import { ComponentFinderService } from 'angular-miniprogram';
//...  
{
  constructor(private componentFinderService: ComponentFinderService) {}
} 

token

import {
  APP_TOKEN,
  PAGE_TOKEN,
} from 'angular-miniprogram';
//...  
{
    constructor(
    @Inject(APP_TOKEN) appInstance: any,
    @Inject(PAGE_TOKEN) pageInstance: any
  ) {}
} 

api

import { pageStartup } from 'angular-miniprogram';
//...
pageStartup(Page1Module, Page1Component);
import { componentRegistry } from 'angular-miniprogram';
//...
componentRegistry(Component1Component);

Static property on @Component

@Component({
  selector: 'app-life-time',
  templateUrl: './life-time.component.html',
})
export class LifeTimePage implements OnInit {
  static mpPageOptions: WechatMiniprogram.Page.Options<{}, {}> = {
    onLoad: function (this: MiniProgramComponentInstance) {
      console.log('mp-onLoad', this.__ngComponentInstance);
    },
    onShow: function () {
      console.log('mp-onShow', this.__ngComponentInstance);
    },
    onReady: function (
      this: WechatMiniprogram.Page.Instance<{}, {}> &
        MiniProgramComponentInstance<LifeTimePage>
    ) {
      console.log('mp-onReady');
    },
  };
//...
}
@Component({
  selector: 'app-life-time-component',
  templateUrl: './life-time.component.html',
  standalone: true,
})
export class LifeTimeComponent implements OnInit {
  static mpComponentOptions: WechatMiniprogram.Component.Options<{}, {}, {}> = {
    lifetimes: {
      created: function (this: MiniProgramComponentInstance) {
        console.log('created(component)');
      },
      attached: function () {
        console.log('attached(component)');
      },
      ready: function () {
        console.log('ready(component)');
      },
      moved: function () {
        console.log('moved(component)');
      },
      detached: function () {
        console.log('detached(component)');
      },
      error: function () {
        console.log('error(component)');
      },
    },
    pageLifetimes: {
      show: function () {
        console.log('page-show(component)');
      },
      hide: function () {
        console.log('page-hide(component)');
      },
      resize: function () {
        console.log('page-resize(component)');
      },
    },
  };
//...
}

Global Variable