ng add @angular/pwa [this will create app/manifest.json]
- ?: doesn't seem to work from CLI in angular-electron app
| // shared/notifier.service.ts | |
| // -OR- | |
| // common/toastr.service.ts | |
| import { Injectable } from '@angular/core'; | |
| // tell compiler toastr is declared elsewhere | |
| let declare toastr:any | |
| toastr.options = { | |
| closeButton : true, | |
| timeOut : '600000' | |
| } | |
| // @Injectable decorator is only rq'd if your service injects other services | |
| @Injectable() | |
| export class Notifier { | |
| error( title : string, msg? : string ) { toastr.error( msg, title ) } | |
| info( title : string, msg? : string ) { toastr.info( msg, title ) } | |
| success( title : string, msg? : string ) { toastr.success( msg, title ) } | |
| } |
| { | |
| "build" : { | |
| "options" : { | |
| "styles": [ | |
| "node_modules/toastr/build/toastr.min.css" | |
| ], | |
| "scripts": [ | |
| "node_modules/toastr/build/toastr.min.js" | |
| ] | |
| } | |
| } | |
| } |
| # /services/admin/notifier.coffee | |
| define ['ng', 's/services', 'toastr'], (angular, services, toastr) -> | |
| toastr.options = | |
| closeButton : true | |
| timeOut : '600000' | |
| services.factory 'notifier', -> | |
| error : (title, msg) -> | |
| toastr.error msg, title | |
| info : (title, msg) -> | |
| toastr.info msg, title | |
| success : (title, msg) -> | |
| toastr.success msg, title |
| { | |
| "name" : "HomeClub", | |
| "short_name" : "HomeClub", | |
| "theme_color" : "#136d6d", | |
| "background_color" : "#fafcfe", | |
| "display" : "standalone", | |
| "scope" : "/", | |
| "start_url" : ".", | |
| "icons" : [ | |
| { | |
| "src" : "favicon.256x256.png", | |
| "sizes" : "256x256", | |
| "type" : "image/png" | |
| }, | |
| { | |
| "src" : "favicon.512x512.png", | |
| "sizes" : "512x512", | |
| "type" : "image/png" | |
| } | |
| ] | |
| } |
| { | |
| "index" : "/index.html", | |
| "assetGroups" : [{ | |
| "name" : "app", | |
| "installMode" : "prefetch", | |
| "resources" : { | |
| "files" : [ | |
| "/favicon.ico", | |
| "/index.html", | |
| "/*.css", | |
| "/*.js" | |
| ] | |
| } | |
| }, { | |
| "name" : "assets", | |
| "installMode" : "lazy", | |
| "updateMode" : "prefetch", | |
| "resources" : { | |
| "files" : [ | |
| "/assets/**" | |
| ] | |
| } | |
| }] | |
| } |