Vertically align Angular Material icons inside Buttons

There are lots of problems with vertical alignment of iconfonts within a <button> when using Angular material buttons. The way I solve this is to utilize the inline attribute. This will cause the icon to correctly scale with the size of the button. <button mat-button> <mat-icon inline=true>local_movies</mat-icon> Movies </button> <!-- Link button --> <a mat-flat-button …

Continue reading Vertically align Angular Material icons inside Buttons

Advertisements

Go fullscreen on Android in NativeScript + Angular

Forcing your Android app to go full-screen is super simple when using NativeScript. In your controller, just do this: import { android as androidApp } from 'tns-core-modules/application'; import { device } from 'tns-core-modules/platform'; declare var android: any; ... private goFullscreen() { if (androidApp && device.sdkVersion >= '21') { const View = android.view.View; const window = …

Continue reading Go fullscreen on Android in NativeScript + Angular

Get Font Awesome 5+ working with NativeScript Angular mobile app

I really like Font Awesome, and I really like NativeScript. I've done some basic native app development before, and images outside of webviews are always a huge pain in the ass. You have to make 50 sizes for all the screen densities, it only png and jpg are supported, there are idiosyncrasies between iOS and …

Continue reading Get Font Awesome 5+ working with NativeScript Angular mobile app

ReactiveX/RxJS/Observables in Angular with a real world example

TL;DR: check out this stackblitz Understanding the concept of Observables is fairly straightforward. Using them to get something real done, when you are first learning, is difficult. The learning curve is well documented, and even great attempts to flatten the curve have been made. Even with all the resources out there, and what I thought …

Continue reading ReactiveX/RxJS/Observables in Angular with a real world example

iOS recorded videos won’t play sound on YouTube. HOWTO fix

Starting with iOS 11, you can record your screen (and audio): iOS "Record your screen" Awesome feature, however when I tried to upload a video I recorded to YouTube the audio did not work. Turns out iOS 11 records two audio tracks, the 1st one being silent 😡 You can remove the silent audio track with …

Continue reading iOS recorded videos won’t play sound on YouTube. HOWTO fix

Use MomentJS/Moment Timezone in Angular efficiently

It seems like every web project I do involves interacting with time, which inevitably evolves into dealing with multiple timezones.  I always go down the road of trying to use the native Javascript Date object, but it never fails that it is not robust enough - even with the new'ish Intl.DateTimeFormat MomentJS to the rescue …

Continue reading Use MomentJS/Moment Timezone in Angular efficiently