ionic serve: how to connect over https to use reserved html5 methods such as geolocation

ionic serve: how to connect over https to use reserved html5 methods such as geolocation

  We all know that at this point https is a must to have. Many  html5 methods, such as geolocation, are blocked from browsers in order to avoid security issues. Often, we bump in these “block” even before we deploy our app. Actually when we deal with these html5 methods, we need to test them …

Read More Read More

Intercepting the value change of an @input()

Intercepting the value change of an @input()

I am working on a component that handles pictures upload, for various reasons, the real upload happens externally. It’s possibile to integrate it in a form or pass to it a callback that is fired after the files are selected. When I use it within a form, I have another component for showing a progressbar, …

Read More Read More

input file: how to manipulate an image before uploading

input file: how to manipulate an image before uploading

UPDATE 2017 July 2st I’ve fixed the source code in order to solve a couple of bug: 1) Files with no exif data crashes the app 2) new Files() on iphone brakes the upload,  formData contains empty files —— I built an angular2+ component that allows selecting and previewing single images before uploading them through …

Read More Read More

Angular: how to add a progress bar to show during a file upload

Angular: how to add a progress bar to show during a file upload

The vanilla  XMLHttpRequest() method implements the”progress” event  and it is pretty easy to use. In angularJS (angular 1) we had to wait till the 1.5.something to have this method supported. In angular (angular 2 which I am talking about) there is no support yet. The easiest way to get this feature, is to use this good lib: …

Read More Read More

How to define the right scope context (this) while passing a callback function to a component

How to define the right scope context (this) while passing a callback function to a component

A super common situation is to pass a callback function to component. Template

  Controller

  The component takes the callback in input

In this scenario the method this.apicall(value) would fail since “this” is not what we expect. To be sure that “this” refers to the controller’s scope, we can add a …

Read More Read More

solve letsencrypt erros in a debian 7

solve letsencrypt erros in a debian 7

I was following the official guide at https://certbot.eff.org/#debianwheezy-apache Is soon as I launched ./certbot-auto –apache I’ got:

Backports saved me!

Et voilà!

Add a layer over an element with 1 css rule

Add a layer over an element with 1 css rule

Sometime we want to make an element like a  picture darker to better read the text over it, we can solve it with 1 css rule without adding any html element.

Parameters are pretty clear, anyway the last one is the opacity.