Skip to content

Commit c7ce34f

Browse files
committed
feat(ngx-material-faq): support angular v6 | material v6 and rxjs v6
1 parent fa92e9a commit c7ce34f

17 files changed

+4079
-4935
lines changed

README.md

+40-20
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,30 @@
2525
View all the directives in action at https://anthonynahas.github.io/ngx-material-faq
2626

2727
## 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
2929

3030
### 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)
3936

4037
```bash
4138
npm i @angular/cdk @angular/material @angular/flex-layout @angular/animations @angular/forms
4239
```
4340

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+
4445

4546
## Installation
4647
Install above dependencies via *npm*.
4748

4849
Now install `ngx-material-faq` via:
4950
```shell
50-
npm install --save ngx-material-faq
51+
npm install -s ngx-material-faq
5152
```
5253

5354
---
@@ -63,30 +64,30 @@ map: {
6364

6465
Once installed you need to import the main module:
6566
```js
66-
import { LibModule } from 'ngx-material-faq';
67+
import { NgxMaterialFaqModule } from 'ngx-material-faq';
6768
```
6869
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()`):
7071
```js
71-
import { LibModule } from 'ngx-material-faq';
72+
import { NgxMaterialFaqModule } from 'ngx-material-faq';
7273

7374
@NgModule({
7475
declarations: [AppComponent, ...],
75-
imports: [LibModule.forRoot(), ...],
76+
imports: [NgxMaterialFaqModule.forRoot(), ...],
7677
bootstrap: [AppComponent]
7778
})
7879
export class AppModule {
7980
}
8081
```
8182

82-
Other modules in your application can simply import ` LibModule `:
83+
Other modules in your application can simply import ` NgxMaterialFaqModule `:
8384

8485
```js
85-
import { LibModule } from 'ngx-material-faq';
86+
import { NgxMaterialFaqModule } from 'ngx-material-faq';
8687

8788
@NgModule({
8889
declarations: [OtherComponent, ...],
89-
imports: [LibModule, ...],
90+
imports: [NgxMaterialFaqModule, ...],
9091
})
9192
export class OtherModule {
9293
}
@@ -99,6 +100,8 @@ add the `ngx-material-faq` or the `ngx-material-faq-admin` element to your templ
99100

100101
### ngx-material-faq
101102

103+
**This component aims to list the provided frequently asked questions**
104+
102105
<p align="center">
103106
<img alt="ngx-material-faq" style="text-align: center;"
104107
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
109112
```
110113

111114
```typescript
115+
import {Component, OnInit, ViewEncapsulation} from '@angular/core';
116+
import {FaqItem} from 'ngx-material-faq';
117+
112118
export class HomeComponent implements OnInit {
119+
120+
ngOnInit() {
121+
}
113122

114123
list: FaqItem[] = [
115124
{
@@ -123,9 +132,14 @@ export class HomeComponent implements OnInit {
123132
];
124133

125134
}
135+
136+
```
126137

127138
### ngx-material-faq-admin
128139

140+
**This component is actually for admin purposes, like to add a frequently
141+
asked question to the backend, firebase ... and so on..**
142+
129143
<p align="center">
130144
<img alt="ngx-material-faq-admin" style="text-align: center;"
131145
src="assets/demo-ngx-material-faq-admin.png">
@@ -138,7 +152,13 @@ export class HomeComponent implements OnInit {
138152
in your component
139153

140154
```typescript
155+
import {Component, OnInit, ViewEncapsulation} from '@angular/core';
156+
import {FaqItem} from 'ngx-material-faq';
157+
141158
export class HomeComponent implements OnInit {
159+
160+
ngOnInit() {
161+
}
142162

143163
faq: FaqItem[] = [];
144164

@@ -154,7 +174,7 @@ export class HomeComponent implements OnInit {
154174

155175
## Development
156176

157-
1. clone this [repo]()
177+
1. clone this [repo](https://github.com/AnthonyNahas/ngx-material-faq)
158178
2. Install the dependencies by running `npm i`
159179
3. build the library `npm run build` or `gulp build`
160180
To generate all `*.js`, `*.d.ts` and `*.metadata.json` files:
@@ -164,10 +184,10 @@ $ npm run build
164184
```
165185

166186
4. Link the library
167-
- on windows `gulp link` or `locally npx gulp link`
187+
- on windows `gulp link` or locally `npx gulp link`
168188
- on mac/linux `sudo gulp link` or locally `sudo npx gulp link`
169189

170-
5. Navigate to the demo app
190+
5. Navigate to the demo app's directory
171191
- `cd demo`
172192
_ `npm i`
173193
_ `npm start`

demo/.angular-cli.json

-88
This file was deleted.

demo/angular.json

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"bsr": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"architect": {
11+
"build": {
12+
"builder": "@angular-devkit/build-angular:browser",
13+
"options": {
14+
"outputPath": "dist/browser",
15+
"index": "src/index.html",
16+
"main": "src/main.ts",
17+
"tsConfig": "src/tsconfig.app.json",
18+
"polyfills": "src/polyfills.ts",
19+
"assets": [
20+
"src/assets",
21+
"src/favicon.ico"
22+
],
23+
"styles": [
24+
"src/styles.scss",
25+
"node_modules/material-design-icons/iconfont/material-icons.css"
26+
],
27+
"scripts": []
28+
},
29+
"configurations": {
30+
"hmr": {
31+
"fileReplacements": [
32+
{
33+
"replace": "src/environments/environment.ts",
34+
"with": "src/environments/environment.hmr.ts"
35+
}
36+
]
37+
},
38+
"production": {
39+
"optimization": true,
40+
"outputHashing": "all",
41+
"sourceMap": false,
42+
"extractCss": true,
43+
"namedChunks": false,
44+
"aot": true,
45+
"extractLicenses": true,
46+
"vendorChunk": false,
47+
"buildOptimizer": true,
48+
"fileReplacements": [
49+
{
50+
"replace": "src/environments/environment.ts",
51+
"with": "src/environments/environment.prod.ts"
52+
}
53+
]
54+
}
55+
}
56+
},
57+
"serve": {
58+
"builder": "@angular-devkit/build-angular:dev-server",
59+
"options": {
60+
"browserTarget": "bsr:build"
61+
},
62+
"configurations": {
63+
"hmr": {
64+
"browserTarget": "bsr:build:hmr"
65+
},
66+
"production": {
67+
"browserTarget": "bsr:build:production"
68+
}
69+
}
70+
},
71+
"extract-i18n": {
72+
"builder": "@angular-devkit/build-angular:extract-i18n",
73+
"options": {
74+
"browserTarget": "bsr:build"
75+
}
76+
},
77+
"test": {
78+
"builder": "@angular-devkit/build-angular:karma",
79+
"options": {
80+
"main": "src/test.ts",
81+
"karmaConfig": "./karma.conf.js",
82+
"polyfills": "src/polyfills.ts",
83+
"tsConfig": "src/tsconfig.spec.json",
84+
"scripts": [],
85+
"styles": [
86+
"src/styles.scss",
87+
"node_modules/material-design-icons/iconfont/material-icons.css"
88+
],
89+
"assets": [
90+
"src/assets",
91+
"src/favicon.ico"
92+
]
93+
}
94+
},
95+
"lint": {
96+
"builder": "@angular-devkit/build-angular:tslint",
97+
"options": {
98+
"tsConfig": [
99+
"src/tsconfig.app.json",
100+
"src/tsconfig.spec.json"
101+
],
102+
"exclude": [
103+
"**/node_modules/**"
104+
]
105+
}
106+
},
107+
"server": {
108+
"builder": "@angular-devkit/build-angular:server",
109+
"options": {
110+
"outputPath": "dist/server",
111+
"main": "main.server.ts",
112+
"tsConfig": "tsconfig.server.json"
113+
}
114+
}
115+
}
116+
},
117+
"bsr-e2e": {
118+
"root": "",
119+
"sourceRoot": "",
120+
"projectType": "application",
121+
"architect": {
122+
"e2e": {
123+
"builder": "@angular-devkit/build-angular:protractor",
124+
"options": {
125+
"protractorConfig": "./protractor.conf.js",
126+
"devServerTarget": "bsr:serve"
127+
}
128+
},
129+
"lint": {
130+
"builder": "@angular-devkit/build-angular:tslint",
131+
"options": {
132+
"tsConfig": [
133+
"e2e/tsconfig.e2e.json"
134+
],
135+
"exclude": [
136+
"**/node_modules/**"
137+
]
138+
}
139+
}
140+
}
141+
}
142+
},
143+
"defaultProject": "bsr",
144+
"schematics": {
145+
"@schematics/angular:component": {
146+
"prefix": "app",
147+
"styleext": "scss"
148+
},
149+
"@schematics/angular:directive": {
150+
"prefix": "app"
151+
}
152+
}
153+
}

0 commit comments

Comments
 (0)