91 lines
3.1 KiB
Plaintext
91 lines
3.1 KiB
Plaintext
# ubuntugis package
|
|
https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa
|
|
|
|
|
|
# update Angular version
|
|
npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations} typescript@latest --save
|
|
|
|
# Fix for NPM installing permission problems
|
|
https://docs.npmjs.com/getting-started/fixing-npm-permissions
|
|
|
|
# Build web app for production
|
|
ng build --prod --aot --build-optimizer
|
|
|
|
//--ssl 1 --ssl-key ../ssl/client-key.pem --ssl-cert ../ssl/client-cert.pem
|
|
|
|
|
|
================app-errorhandler.ts=======================
|
|
import { Injectable, ErrorHandler } from "@angular/core";
|
|
|
|
import { Subject, Observable, empty } from "rxjs";
|
|
import { catchError } from "rxjs/operators";
|
|
|
|
export class APIError {
|
|
text: string;
|
|
tag: string;
|
|
}
|
|
|
|
@Injectable()
|
|
export class AppErrorHandler implements ErrorHandler {
|
|
|
|
private _error$: Subject<any>;
|
|
private _msgs: any;
|
|
|
|
constructor(err$, msgs) {
|
|
this._error$ = err$;
|
|
this._msgs = msgs;
|
|
}
|
|
|
|
handleError = <T>(source$: Observable<T>) => source$.pipe(
|
|
catchError(err => {
|
|
const etag = err.error.error ? err.error.error['.tag'] || '' : '';
|
|
let etext = 'Unknown Error';
|
|
if (etag && this._msgs && etag in this._msgs)
|
|
etext = this._msgs[etag];
|
|
this._error$.next(<APIError>{ text: etext, tag: etag });
|
|
return empty();
|
|
})
|
|
)
|
|
}
|
|
|
|
// Local FF Dev path: ~/.local/share/umake/web/firefox-dev
|
|
|
|
#======================================================================
|
|
Responsive
|
|
Responsive layout is achieved by applying additional classes to the columns whereas ui-g-* define the default behavior. Four screen sizes are supported with different breakpoints.
|
|
CODE: SELECT ALL
|
|
|
|
Prefix Devices Media Query Example
|
|
ui-sm-* Phones max-width: 40em (640px) ui-sm-6, ui-sm-4
|
|
ui-md-* Tablets min-width: 40.063em (641px) ui-md-2, ui-sm-8
|
|
ui-lg-* Desktops min-width: 64.063em (1025px) ui-lg-6, ui-sm-12
|
|
ui-xl-* Big screen monitors min-width: 90.063em (1441px) ui-xl-2, ui-sm-10
|
|
Most of the time, ui-md-* styles are used with default ui-g-* classes, to customize small or large screens apply ui-sm, ui-lg and ui-xl can be utilized.
|
|
|
|
# My Dark Sky weather API key:
|
|
5cfb5e43ff89ab7b40ba08f57f5a7235
|
|
|
|
# PrimeNG Issue Template - to report bugs or issues with primeng components
|
|
https://stackblitz.com/github/primefaces/primeng-issue-template
|
|
|
|
# Install this for xliffmerge tool
|
|
npm install -g ngx-i18nsupport
|
|
|
|
|
|
|
|
// Angular
|
|
- Custom form controls are simply components that implement the ControlValueAccessor interface. By implementing this interface, our custom controls can now work with Template and Reactive Forms APIs seamlessly providing a great developer experience to those using our components.
|
|
|
|
// ng generate component
|
|
ng g c /shared/profile-form --selector=user-profile-form --skip-tests -m=app-shared
|
|
|
|
// GRecaptcha SiteKey
|
|
6Le2EAAnAAAAAJHA-UKaFb8IIpaq7wo-TSvvCnQF
|
|
|
|
// GRecaptcha SecKey
|
|
6Le2EAAnAAAAABy_7enAqU0k1M4GiwcXtB14iMMB
|
|
|
|
// Resolve peer dependencies unmatched issue:
|
|
npm i --legacy-peer-deps
|
|
or npm config set legacy-peer-deps true
|