ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
62 lines (52 loc) • 1.83 kB
Markdown
---
title:
zh-CN: 基础样例
en-US: Basic Usage
order: 0
---
## zh-CN
最简单的用法。
## en-US
Simplest of usage.
```ts
import { Component } from '@angular/core';
import { OnboardingService } from '@ohayo/components/onboarding';
import { _HttpClient } from '@ohayo/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
export class DemoComponent {
constructor(private srv: OnboardingService, private msg: NzMessageService, private http: _HttpClient) {}
handleClick(): void {
this.msg.info(`click`);
}
start(): void {
this.srv.start({
items: [
{ selectors: '.test1-1', content: 'The user guidance is to help users better understand and use the product', width: 300 },
{ selectors: '.test1-2', title: 'Test2', content: 'The user guidance is to help users better understand and use the product' },
{ selectors: '.test1-3', title: 'Test3', content: 'The user guidance is to help users better understand and use the product' },
],
});
}
viaHttp(): void {
this.http.get(`./assets/schema/onboarding.json`).subscribe(res => {
console.log(res);
this.srv.start(res);
});
}
}
```