Skip to content

Commit f570513

Browse files
committed
feat(docs): Turn demo app into a PWA
fixes #30
1 parent d33fa5d commit f570513

15 files changed

Lines changed: 171 additions & 2 deletions

angular.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
"tsConfig": "projects/ngqp-demo/tsconfig.app.json",
5656
"assets": [
5757
"projects/ngqp-demo/src/favicon.ico",
58-
"projects/ngqp-demo/src/assets"
58+
"projects/ngqp-demo/src/assets",
59+
"projects/ngqp-demo/src/manifest.json"
5960
],
6061
"styles": [
6162
"projects/ngqp-demo/src/styles.scss"
@@ -85,7 +86,8 @@
8586
"maximumWarning": "2mb",
8687
"maximumError": "5mb"
8788
}
88-
]
89+
],
90+
"serviceWorker": true
8991
}
9092
}
9193
},

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
"@angular/forms": "~7.1.0",
3232
"@angular/platform-browser": "~7.1.0",
3333
"@angular/platform-browser-dynamic": "~7.1.0",
34+
"@angular/pwa": "^0.12.1",
3435
"@angular/router": "~7.1.0",
36+
"@angular/service-worker": "~7.1.0",
3537
"@fortawesome/angular-fontawesome": "^0.3.0",
3638
"@fortawesome/fontawesome-svg-core": "^1.2.10",
3739
"@fortawesome/free-brands-svg-icons": "^5.6.1",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"index": "/index.html",
3+
"assetGroups": [
4+
{
5+
"name": "app",
6+
"installMode": "prefetch",
7+
"resources": {
8+
"files": [
9+
"/favicon.ico",
10+
"/index.html",
11+
"/*.css",
12+
"/*.js"
13+
]
14+
}
15+
},
16+
{
17+
"name": "assets",
18+
"installMode": "lazy",
19+
"updateMode": "prefetch",
20+
"resources": {
21+
"files": [
22+
"/assets/**"
23+
]
24+
}
25+
}
26+
]
27+
}

projects/ngqp-demo/src/app/demo.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import { GlobalConfigurationDocsComponent } from './docs-items/global-configurat
3434
import { CustomControlValueAccessorDocsComponent } from './docs-items/custom-control-value-accessor/custom-control-value-accessor-docs.component';
3535
import { ControlValueAccessorDirectiveExampleComponent } from './docs-items/examples/control-value-accessor-directive-example/control-value-accessor-directive-example.component';
3636
import { ManualWiringExampleComponent } from './docs-items/examples/manual-wiring-example/manual-wiring-example.component';
37+
import { ServiceWorkerModule } from '@angular/service-worker';
38+
import { environment } from '../environments/environment';
3739

3840
@NgModule({
3941
declarations: [
@@ -79,6 +81,7 @@ import { ManualWiringExampleComponent } from './docs-items/examples/manual-wirin
7981
NgbModule,
8082
FontAwesomeModule,
8183
QueryParamModule,
84+
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
8285
],
8386
bootstrap: [ DemoComponent ]
8487
})
4.68 KB
Loading
5.18 KB
Loading
5.5 KB
Loading
6.79 KB
Loading
13.7 KB
Loading
18.6 KB
Loading

0 commit comments

Comments
 (0)