Today I was having an issue with one of my forms misbehaving (or so I thought) while validating errors. The Submit button is disabled by default if there are any vaidation errors. But where are these errors coming from? Then I asked help from a friend (thanks Jon MacInnes) who showed me a very clever code snippet for figuring out what validation is doing on my form. If you, like me, have similar issues, just inject the following piece of code in your form and debug away Make sure you change the form name and the position to fit your …[read more]
Showing all posts tagged: 'AngularJs'
A 2-post collection
AngularJs has an impressive and robust logging mechanism through the $logService and $log injection. However, Angular logs everything to the console, which is neither a robust or scalable solution. Sometimes, you need to be able to intercept the exceptions and do something extra. This could be as simple as adding extra information or sending all logs to the server/database. Below I've included two different ways that you can achieve that. Option 1 The first one is pretty simple and allows you to hook into the $exceptionHandler and pass a logger in the form of an AngularJs factory. The factory …[read more]