Skip to content

Commit 6704dcd

Browse files
committed
docs(ngx-material-faq): added documentation - readme + assets
1 parent 5277ad7 commit 6704dcd

File tree

6 files changed

+236
-0
lines changed

6 files changed

+236
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
IF YOU DON'T FILL OUT THE FOLLOWING INFORMATION YOUR ISSUE MIGHT BE CLOSED WITHOUT INVESTIGATING
3+
-->
4+
### Bug Report or Feature Request (mark with an `x`)
5+
```
6+
- [ ] bug report -> please search issues before submitting
7+
- [ ] feature request
8+
```
9+
10+
### OS and Version?
11+
<!--
12+
> Windows 7, 8 or 10. Linux (which distribution).macOS(Yosemite ? El Capitan? Sierra ?)
13+
-->
14+
15+
### Versions
16+
<!--
17+
Output from: `ng --version`, in case you are using Angular CLI.
18+
Otherwise, output from: `node --version` , `npm --version` and Angular version.
19+
-->
20+
21+
22+
### Repro steps
23+
<!--
24+
Simple steps to reproduce this bug.
25+
Please include: commands run, packages added, related code changes.
26+
A link to a sample repo would help too.
27+
-->
28+
29+
30+
### The log given by the failure
31+
<!-- Normally this include a stack trace and some more information. -->
32+
33+
34+
### Desired functionality
35+
<!--
36+
What would like to see implemented?
37+
What is the usecase?
38+
-->
39+
40+
41+
### Mention any other details that might be useful
42+
<!-- Please include a link to the repo if this is related to an OSS project. -->

README.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<p align="center">
2+
<img height="256px" width="256px" style="text-align: center;" src="https://cdn.rawgit.com/anthonynahas/ngx-material-faq/master/demo/src/assets/logo.svg">
3+
</p>
4+
5+
# ngx-material-faq - Angular Library built with material design in order to provide a reusable faq (frequently asked questions) component for every project. Ask, Answer and List
6+
7+
[![npm version](https://badge.fury.io/js/ngx-material-faq.svg)](https://badge.fury.io/js/ngx-material-faq),
8+
[![npm](https://img.shields.io/badge/demo-online-ed1c46.svg)](https://anthonynahas.github.io/ngx-material-faq)
9+
[![Coverage Status](https://coveralls.io/repos/github/anthonynahas/ngx-material-faq/badge.svg?branch=master)](https://coveralls.io/github/anthonynahas/ngx-material-faq?branch=master)
10+
[![Coverage Status](https://coveralls.io/repos/github/anthonynahas/ngx-material-faq/badge.svg?branch=master)](https://coveralls.io/github/anthonynahas/ngx-material-faq?branch=master)
11+
[![dependency Status](https://david-dm.org/anthonynahas/ngx-material-faq/status.svg)](https://david-dm.org/anthonynahas/ngx-material-faq)
12+
[![devDependency Status](https://david-dm.org/anthonynahas/ngx-material-faq/dev-status.svg?branch=master)](https://david-dm.org/anthonynahas/ngx-material-faq#info=devDependencies)
13+
[![Greenkeeper Badge](https://badges.greenkeeper.io/anthonynahas/ngx-material-faq.svg)](https://greenkeeper.io/)
14+
[![license](https://img.shields.io/github/license/anthonynahas/ngx-material-faq.svg?style=flat-square)](https://github.com/AnthonyNahas/ngx-material-faq/blob/master/LICENSE)
15+
16+
17+
<p align="center">
18+
<img alt="ngx-material-faq" style="text-align: center;"
19+
src="assets/demo.gif">
20+
</p>
21+
22+
23+
## Demo
24+
25+
View all the directives in action at https://anthonynahas.github.io/ngx-material-faq
26+
27+
## Dependencies
28+
* [Angular](https://angular.io) (*requires* Angular 2 or higher, tested with 2.0.0)
29+
30+
### Requirements (peer dependencies):
31+
- [angular flex-layout ](https://www.npmjs.com/package/@angular/flex-layout)
32+
- [angular material ](https://www.npmjs.com/package/@angular/material)
33+
- [angular material theme](https://material.angular.io/guide/getting-started#step-4-include-a-theme)
34+
- [angular cdk ](https://www.npmjs.com/package/@angular/cdk)
35+
- [angular animations ](https://www.npmjs.com/package/@angular/animations)
36+
- [angular forms ](https://www.npmjs.com/package/@angular/forms)
37+
- if you need a built in theme --> please let me know
38+
39+
40+
```bash
41+
npm i @angular/cdk @angular/material @angular/flex-layout @angular/animations @angular/forms
42+
```
43+
44+
45+
## Installation
46+
Install above dependencies via *npm*.
47+
48+
Now install `ngx-material-faq` via:
49+
```shell
50+
npm install --save ngx-material-faq
51+
```
52+
53+
---
54+
##### SystemJS
55+
>**Note**:If you are using `SystemJS`, you should adjust your configuration to point to the UMD bundle.
56+
In your systemjs config file, `map` needs to tell the System loader where to look for `ngx-material-faq`:
57+
```js
58+
map: {
59+
'ngx-material-faq': 'node_modules/ngx-material-faq/bundles/ngx-material-faq.umd.js',
60+
}
61+
```
62+
---
63+
64+
Once installed you need to import the main module:
65+
```js
66+
import { LibModule } from 'ngx-material-faq';
67+
```
68+
The only remaining part is to list the imported module in your application module. The exact method will be slightly
69+
different for the root (top-level) module for which you should end up with the code similar to (notice ` LibModule .forRoot()`):
70+
```js
71+
import { LibModule } from 'ngx-material-faq';
72+
73+
@NgModule({
74+
declarations: [AppComponent, ...],
75+
imports: [LibModule.forRoot(), ...],
76+
bootstrap: [AppComponent]
77+
})
78+
export class AppModule {
79+
}
80+
```
81+
82+
Other modules in your application can simply import ` LibModule `:
83+
84+
```js
85+
import { LibModule } from 'ngx-material-faq';
86+
87+
@NgModule({
88+
declarations: [OtherComponent, ...],
89+
imports: [LibModule, ...],
90+
})
91+
export class OtherModule {
92+
}
93+
```
94+
95+
## Usage
96+
97+
add the `ngx-material-faq` or the `ngx-material-faq-admin` element to your template:
98+
99+
100+
### ngx-material-faq
101+
102+
<p align="center">
103+
<img alt="ngx-material-faq" style="text-align: center;"
104+
src="assets/demo-ngx-material-faq.png">
105+
</p>
106+
107+
```html
108+
<ngx-material-faq [faqList]="list"></ngx-material-faq>
109+
```
110+
111+
```typescript
112+
export class HomeComponent implements OnInit {
113+
114+
list: FaqItem[] = [
115+
{
116+
question: 'Why does it think the jQuery plugin is missing?',
117+
answer: 'Remember: load jQuery before AngularJS if you are using jQuery plugins!'
118+
},
119+
{
120+
question: 'How do I access the DOM from a controller?',
121+
answer: 'DO NOT perform DOM selection/traversal from the controller. The HTML hasn\'t rendered yet. Look up \'directives\'.'
122+
}
123+
];
124+
125+
}
126+
127+
### ngx-material-faq-admin
128+
129+
<p align="center">
130+
<img alt="ngx-material-faq-admin" style="text-align: center;"
131+
src="assets/demo-ngx-material-faq-admin.png">
132+
</p>
133+
134+
```html
135+
<ngx-material-faq-admin [title]="'Admin'" (onFAQItemAdded)="onNewFaqItem($event)"></ngx-material-faq-admin>
136+
```
137+
138+
in your component
139+
140+
```typescript
141+
export class HomeComponent implements OnInit {
142+
143+
faq: FaqItem[] = [];
144+
145+
onNewFaqItem(faqItem: FaqItem) {
146+
console.log('on new faqItem -> ', faqItem);
147+
this.faq.splice(0, 0, faqItem);
148+
}
149+
150+
}
151+
```
152+
153+
### Please checkout the full documentation [here](https://anthonynahas.github.io/ngx-material-faq/doc/index.html) or follow the official [tutorial](https://anthonynahas.github.io/ngx-material-faq/getting-started)
154+
155+
## Development
156+
157+
1. clone this [repo]()
158+
2. Install the dependencies by running `npm i`
159+
3. build the library `npm run build` or `gulp build`
160+
To generate all `*.js`, `*.d.ts` and `*.metadata.json` files:
161+
162+
```bash
163+
$ npm run build
164+
```
165+
166+
4. Link the library
167+
- on windows `gulp link` or `locally npx gulp link`
168+
- on mac/linux `sudo gulp link` or locally `sudo npx gulp link`
169+
170+
5. Navigate to the demo app
171+
- `cd demo`
172+
_ `npm i`
173+
_ `npm start`
174+
175+
extras
176+
To lint all `*.ts` files:
177+
178+
```bash
179+
$ npm run lint
180+
```
181+
182+
183+
## Other Angular Libraries
184+
- [ngx-auth-firebaseui](https://github.com/AnthonyNahas/ngx-auth-firebaseui)
185+
- [ngx-material-pages](https://github.com/AnthonyNahas/ngx-material-pages)
186+
- [ngx-material-password-strength](https://github.com/AnthonyNahas/ngx-material-password-strength)
187+
- [ngx-material-contacts](https://github.com/AnthonyNahas/ngx-material-contacts)
188+
- [ngx-combination-generator](https://github.com/AnthonyNahas/combination-generator)
189+
190+
191+
## License
192+
193+
Copyright (c) 2018 anthonynahas. Licensed under the MIT License (MIT)
194+
57.4 KB
Loading

assets/demo-ngx-material-faq.png

83.6 KB
Loading

assets/demo.gif

12.6 MB
Loading

assets/demo.mp4

1.06 MB
Binary file not shown.

0 commit comments

Comments
 (0)