25
25
View all the directives in action at https://anthonynahas.github.io/ngx-material-faq
26
26
27
27
## Dependencies
28
- * [ Angular] ( https://angular.io ) (* requires* Angular 2 or higher, tested with 2.0.0)
28
+ * [ Angular v6.0.1 ] ( https://angular.io ) (* requires* Angular 2 or higher, tested with 2.0.0) - Angular V6 - Material V6 are now supported
29
29
30
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
-
31
+ - [ angular flex-layout v6.0.0-beta.15] ( https://www.npmjs.com/package/@angular/flex-layout )
32
+ - [ angular material v6.0.2] ( https://www.npmjs.com/package/@angular/material )
33
+ - [ angular cdk v6.0.2] ( https://www.npmjs.com/package/@angular/cdk )
34
+ - [ angular animations v6.0.1] ( https://www.npmjs.com/package/@angular/animations )
35
+ - [ angular forms v6.0.1] ( https://www.npmjs.com/package/@angular/forms )
39
36
40
37
``` bash
41
38
npm i @angular/cdk @angular/material @angular/flex-layout @angular/animations @angular/forms
42
39
```
43
40
41
+ ### Additional requirements (Material Design)
42
+ - [ angular material theme] ( https://material.angular.io/guide/getting-started#step-4-include-a-theme )
43
+ - [ angular material icons] ( https://material.angular.io/guide/getting-started#step-6-optional-add-material-icons )
44
+
44
45
45
46
## Installation
46
47
Install above dependencies via * npm* .
47
48
48
49
Now install ` ngx-material-faq ` via:
49
50
``` shell
50
- npm install --save ngx-material-faq
51
+ npm install -s ngx-material-faq
51
52
```
52
53
53
54
---
@@ -63,30 +64,30 @@ map: {
63
64
64
65
Once installed you need to import the main module:
65
66
``` js
66
- import { LibModule } from ' ngx-material-faq' ;
67
+ import { NgxMaterialFaqModule } from ' ngx-material-faq' ;
67
68
```
68
69
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
+ different for the root (top-level) module for which you should end up with the code similar to (notice ` NgxMaterialFaqModule .forRoot() ` ):
70
71
``` js
71
- import { LibModule } from ' ngx-material-faq' ;
72
+ import { NgxMaterialFaqModule } from ' ngx-material-faq' ;
72
73
73
74
@NgModule ({
74
75
declarations: [AppComponent, ... ],
75
- imports: [LibModule .forRoot (), ... ],
76
+ imports: [NgxMaterialFaqModule .forRoot (), ... ],
76
77
bootstrap: [AppComponent]
77
78
})
78
79
export class AppModule {
79
80
}
80
81
```
81
82
82
- Other modules in your application can simply import ` LibModule ` :
83
+ Other modules in your application can simply import ` NgxMaterialFaqModule ` :
83
84
84
85
``` js
85
- import { LibModule } from ' ngx-material-faq' ;
86
+ import { NgxMaterialFaqModule } from ' ngx-material-faq' ;
86
87
87
88
@NgModule ({
88
89
declarations: [OtherComponent, ... ],
89
- imports: [LibModule , ... ],
90
+ imports: [NgxMaterialFaqModule , ... ],
90
91
})
91
92
export class OtherModule {
92
93
}
@@ -99,6 +100,8 @@ add the `ngx-material-faq` or the `ngx-material-faq-admin` element to your templ
99
100
100
101
### ngx-material-faq
101
102
103
+ ** This component aims to list the provided frequently asked questions**
104
+
102
105
<p align =" center " >
103
106
<img alt="ngx-material-faq" style="text-align: center;"
104
107
src="assets/demo-ngx-material-faq.png">
@@ -109,7 +112,13 @@ add the `ngx-material-faq` or the `ngx-material-faq-admin` element to your templ
109
112
```
110
113
111
114
``` typescript
115
+ import {Component , OnInit , ViewEncapsulation } from ' @angular/core' ;
116
+ import {FaqItem } from ' ngx-material-faq' ;
117
+
112
118
export class HomeComponent implements OnInit {
119
+
120
+ ngOnInit() {
121
+ }
113
122
114
123
list: FaqItem [] = [
115
124
{
@@ -123,9 +132,14 @@ export class HomeComponent implements OnInit {
123
132
];
124
133
125
134
}
135
+
136
+ ```
126
137
127
138
### ngx-material-faq-admin
128
139
140
+ ** This component is actually for admin purposes, like to add a frequently
141
+ asked question to the backend, firebase ... and so on..**
142
+
129
143
<p align =" center " >
130
144
<img alt="ngx-material-faq-admin" style="text-align: center;"
131
145
src="assets/demo-ngx-material-faq-admin.png">
@@ -138,7 +152,13 @@ export class HomeComponent implements OnInit {
138
152
in your component
139
153
140
154
``` typescript
155
+ import {Component , OnInit , ViewEncapsulation } from ' @angular/core' ;
156
+ import {FaqItem } from ' ngx-material-faq' ;
157
+
141
158
export class HomeComponent implements OnInit {
159
+
160
+ ngOnInit() {
161
+ }
142
162
143
163
faq: FaqItem [] = [];
144
164
@@ -154,7 +174,7 @@ export class HomeComponent implements OnInit {
154
174
155
175
## Development
156
176
157
- 1. clone this [repo ]()
177
+ 1 . clone this [ repo] ( https://github.com/AnthonyNahas/ngx-material-faq )
158
178
2 . Install the dependencies by running ` npm i `
159
179
3 . build the library ` npm run build ` or ` gulp build `
160
180
To generate all ` *.js ` , ` *.d.ts ` and ` *.metadata.json ` files:
@@ -164,10 +184,10 @@ $ npm run build
164
184
```
165
185
166
186
4 . Link the library
167
- - on windows ` gulp link ` or ` locally npx gulp link `
187
+ - on windows ` gulp link ` or locally ` npx gulp link `
168
188
- on mac/linux ` sudo gulp link ` or locally ` sudo npx gulp link `
169
189
170
- 5. Navigate to the demo app
190
+ 5 . Navigate to the demo app's directory
171
191
- ` cd demo `
172
192
_ ` npm i `
173
193
_ ` npm start `
0 commit comments