What’s the difference between “Request Payload” vs “Form Data” as seen in Chrome dev tools Network tab

The Request Payload – or to be more precise: payload body of a HTTP Request is the data normally send by a POST or PUT Request. It’s the part after the headers and the CRLF of a HTTP Request. A request with Content-Type: application/json may look like this: If you submit this per AJAX the browser simply shows you what it is … Read more

Square brackets in CSS

It’s an attribute selector in CSS E[foo=”warning”] Matches any E element whose “foo” attribute value is exactly equal to “warning”. more on http://www.w3.org/TR/CSS2/selector.html

How to create a HTML Cancel button that redirects to a URL

cancel is not a valid value for a type attribute, so the button is probably defaulting to submit and continuing to submit the form. You probably mean type=”button”. (The javascript: should be removed though, while it doesn’t do any harm, it is an entirely useless label) You don’t have any button-like functionality though, so would be better off with: … possibly with … Read more

Cleanest way to reset forms

Add a reference to the ngForm directive in your html code and this gives you access to the form, so you can use .resetForm(). …Or pass the form to a function: The difference between resetForm and reset is that the former will clear the form fields as well as any validation, while the later will only clear the fields. Use resetForm after the form … Read more