Angular Material v6 Mat-Footer – “Cannot read property ‘template’ of undefined”
FIXED: This was not made clear in the material documentation, but all columns must contain a <mat-footer-cell/> element, even if only one column will contain content.
FIXED: This was not made clear in the material documentation, but all columns must contain a <mat-footer-cell/> element, even if only one column will contain content.
For recent first: this.data.sort((a, b) => new Date(b.date1).getTime() – new Date(a.date1).getTime()); For OlderFirst: this.data.sort((b, a) => new Date(b.date1).getTime() – new Date(a.date1).getTime());
Here is a simple visual to see the difference: As seen above … an Observable is a stream of events or data. They are often returned from Angular methods, such as the http.get and the myinputBox.valueChanges. Subscribing “kicks off” the observable stream. Without a subscribe (or an async pipe) the stream won’t start emitting values. … Read more
For global styles, I’ve answered it in this question. Update For ng-packgr versions 9.x and above Copying assest to output folder is now directly supported as explained in this page { “$schema”: “./node_modules/ng-packagr/package.schema.json”, “name”: “@my/library”, “version”: “1.0.0”, “ngPackage”: { “assets”: [ “CHANGELOG.md”, “./styles/**/*.theme.scss” ], “lib”: { … } } } So in your project you … Read more
Best possible solution I could come up with till now. You would have to install the below packages from npm html2canvas jspdf import * as jsPDF from ‘jspdf’; import html2canvas from ‘html2canvas’; htmltoPDF() { // parentdiv is the html element which has to be converted to PDF html2canvas(document.querySelector(“#parentdiv”)).then(canvas => { var pdf = new jsPDF(‘p’, … Read more
browserTarget is a setting that maps a configuration to a build target e.g. build, serve, test, lint. It’s kind of a funny name. To be honest I don’t know why it’s called browserTarget instead of just target. Further reading here at the angular.io docs.
TL; DR You should not treat environment.ts as something similar to process.env. The name is similar but the behaviour is absolutely not. All the settings from environment.ts will directly go to your code. That’s why it is not secure to put secrets to environments.ts in any way. The browser alternatives to environment variables (process.env) are … Read more
In polyfill.ts, add this line: (window as any).process = { env: { DEBUG: undefined }, }; Reference: https://github.com/algolia/algoliasearch-client-javascript/issues/691 Or npm i -S process, then add this to polyfill.ts: import * as process from ‘process’; window[‘process’] = process;
It looks like adding the package name to a “whitelistedNonPeerDependencies” collection in the ng-package.json file will resolve this build issue. I’m still not sure what the best practice is here though. Should we create angular libraries that have dependancies on other npm packages or is it best to only have peerDependancies? ng-package.json file: { “$schema”: … Read more
It is: this.http.get<Category[]>(this.endpoint).pipe( map(results => results.sort(…)) ); Or since sort modifies existing array, it’s more semantically correct to provide side effects in do/tap: this.http.get<Category[]>(this.endpoint).pipe( tap(results => { results.sort() }) );