0.0.2 • Published 6 years ago
ngx-wechat-qrcode v0.0.2
What
this is an angular component to generate qrcode for wechat, it also use in login that use wechat to your site
How to use
install
install: npm install ngx-wechat-qrcode --save
import
@NgModule({
imports: [
NgxWechatQrcodeModule
],
declarations: [
...
],
exports: [
...
],
})
use in template
<ngx-wechat-qrcode [width]="'300'" [height]="'400'" [config]="wechatConfig"></ngx-wechat-qrcode>
use in ts
wechatConfig:WechatConfig;
wechatInit(): void {
this.wechatConfig = new WechatConfig(false, 'qrcode_wechat', environment.Wechat.appid, environment.Wechat.redirect_url, null, 'black', null);
}
WechatConfig
see wechat api
self_redirect: boolean;
id: string;
appid: string;
scope: string;
redirect_uri: string;
state: any;
style: 'black' | 'white';
href: string;
constructor(self_redirect: boolean, id: string, appid: string, redirect_uri: string, state: any, style: "black" | "white", href: string);
getUrl(): string;