This is an easy gotcha:
Author Archives: lucia
“Angular” Sanitize
We don’t actually need $sanitize
to sanitize strings.
ng-bind
automatically implements sanitizing in the background with textContent
. However, sometimes we need to pass string in as template in controllers and services, or pass it in as the exact content of “name
” attribute of an input, then $sanitize
doesn’t work anymore.
Creating & Applying Git Patches
Module parse failed with HTML template
Error:
Module parse failed: <...> You may need an appropriate loader to handle this file type.
How to: Prevent Body From Scrolling
After I accidentally stumbled upon the solution to “preventing body scrolling when overlay is on” by trying too many different things again and again, I wasn’t able to explain exactly why this works.
Reduce Webpack Style Loader Runtime
If you @import a lot of scss/sass/css files, the style loader can take a looong time to finish loading. How to improve? Lets take a look at what each of them does:
NPM: ERRORINUSE
For error:
Error: listen EADDRINUSE :::3042
We just need to kill whatever that’s on the port. Probably the last exit wasn’t clean. Do:
$ lsof -i :3042 // to find out the PID number $ kill -9 PID // kill the process with its PID
Angular: Requiring ng-model as Component
To turn a custom component of an input element into a ng-model
/validation enabled one, and to be able to use NgModelController
and all its fancy methods in its controller: