Wednesday, December 26, 2018

Write a general purpose Angular 2+ comments

As long as there is something in your website to show to users, there must be urgent of your users to comment on that something. This is always true for any content-providing website. After all, what's the good of a website if you can't dump any of your garbage opinions on its garbage content.

Why sanitize html context ?

Image this situation when you write a blogger, or a forum, or an online editor for 3 GODDAMN 研究紀錄簿s every month like this one, whatever.
If your editor supports only pure text that will be so lame, right? So basically what you need is an editor which enables users to input their colourful HTML encoded content.

Tuesday, December 25, 2018

Write Angular 2+ Custom Form Control

We use form to collect data from user and save it as an object, a record, or a document into backend data-storage.
In simple case like User profile, all we got are name, email, phone number, age, birthday ...etc., nothing more than a string, number, or date, there are already built-in html5 inputs to handle data of these certain types, and Angular 2+ also integrated them naturally, but how about data field of some more complicated type? or when the ordinary flat inputs can not satisfy my desire for a more splendid UI ?