UNPKG

3.47 kBMarkdownView Raw
1# WECHATY NGMODULE
2
3[![Build Status](https://travis-ci.org/Chatie/angular.svg?branch=master)](https://travis-ci.org/Chatie/angular)
4[![npm version](https://badge.fury.io/js/%40chatie%2Fangular.svg)](https://www.npmjs.com/package/@chatie/angular)
5[![Greenkeeper badge](https://badges.greenkeeper.io/Chatie/angular.svg)](https://greenkeeper.io/)
6
7Wechaty Web Component NgModule Powered by Angular 5 & ng-packagr
8
9![Angular Library](https://chatie.github.io/angular/images/library-in-angular.jpg)
10
11> Picture credit: [How to create an Angular library](http://www.dzurico.com/how-to-create-an-angular-library/)
12
13## USAGE
14
15### Demo
16
17<https://chatie.io/angular/>
18
19Talk is cheap, show me the code:
20
21### App Module
22
23```ts
24import { WechatyModule } from '@chatie/angular'
25
26@NgModule({
27 ...
28 imports: [
29 WechatyModule,
30 ],
31 ...
32})
33
34```
35
36### Html Component
37
38```html
39<wechaty
40 #wechaty
41 token="WECHATY_TOKEN"
42
43 (error) = "onEvent('error' , $event)"
44 (heartbeat) = "onEvent('heartbeat' , $event)"
45 (login) = "onEvent('login' , $event)"
46 (logout) = "onEvent('logout' , $event)"
47 (message) = "onEvent('message' , $event)"
48 (scan) = "onEvent('scan' , $event)"
49>
50</wechaty>
51
52<button (click)="wechaty.shutdown()"> Shutdown</button>
53
54```
55
56Moer details, see code. ;-]
57
58## REFERENCES
59
60* [How to build and publish an Angular module](https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464)
61* [Understanding Angular modules (NgModule) and their scopes](https://medium.com/@cyrilletuzi/understanding-angular-modules-ngmodule-and-their-scopes-81e4ed6f7407)
62* [Making your Angular 2 library statically analyzable for AoT](https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5)
63* [Getting your Angular 2 library ready for AoT](https://medium.com/@isaacplmann/getting-your-angular-2-library-ready-for-aot-90d1347bcad)
64* [Documentation for Angular Metadata Raw](https://gist.github.com/chuckjaz/65dcc2fd5f4f5463e492ed0cb93bca60)
65* [Ahead-of-Time Compilation in Angular](http://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/)
66* [Plunker - Adding the embed to your website](https://ggoodman.gitbooks.io/plunker/content/embed.html)
67
68## NPM
69
70* [Working with scoped packages](https://docs.npmjs.com/getting-started/scoped-packages)
71
72## CHANGELOG
73
74### v0.3 master (May 2018)
75
761. Support CI/CD to NPM@next
77
78### v0.2 (Apr 2018)
79
801. Upgrade Angular from v4 to v5
811. use `ng-packagr` to pack NgModule(instead of tsc&rollup by hand)
82
83### v0.1 (May 2017)
84
851. Upgrade Angular from v2 to v4
861. NgModule-ize Wachaty Component
871. Playground: <https://chatie.io/angular/>
88
89### v0.0.1 (Jul 2016)
90
911. Modulized Angular 2 Component: `wechaty-core`
921. Support all(and same) IO Events of [Wechaty](https://github.com/chatie/wechaty)
93
94## SUPPORT
95
96Github Issue - https://github.com/chatie/angular/issues
97
98## AUTHOR
99
100Huan LI <zixia@zixia.net> (http://linkedin.com/in/zixia)
101
102<a href="http://stackoverflow.com/users/1123955/zixia">
103 <img src="http://stackoverflow.com/users/flair/1123955.png" width="208" height="58" alt="profile for zixia at Stack Overflow, Q&amp;A for professional and enthusiast programmers" title="profile for zixia at Stack Overflow, Q&amp;A for professional and enthusiast programmers">
104</a>
105
106## COPYRIGHT & LICENSE
107
108* Code & Docs ©2016-2018 zixia
109* Code released under the Apache-2.0 license
110* Docs released under Creative Commons