Implementation custom Model validation is typically done by extending the built-in $error
object to ngForm
models.
Prior to AngularJS 1.3 custom validation was done by injecting a function into the ngModel.$parsers
array pipeline and manually setting validation states using $setValidity('visa', true)
if the Model value matched a Visa credit card expression format, for example.
AngularJS 1.3+ has the $validators
pipeline object, which requires no manual setting of validation states.
Let’s take a look of old school way then we can shift to ngModel.$validators
technique.
To rock the interview to achieve what you deserve and to improve your concepts about front end technologies, I have consolidated a list of questions and answers. It’s a one stop solution for front end interview process.
AngularJS 1.5 introduce .component()
helper method which is much simpler than the .directive()
definitions and advocates best practices and common default behavior.
Using .component()
will allow to write in Angular 2 style as well, which will turn transition to Angular 2 much easier.
Let’s compare the difference in syntax and the possibility of new abstraction.
Being a SOLID developer in JS isn’t so as straight forward as in other languages. Some developers consider functional approach. Others chose OOP style. Some stand in both line. And other think that having class is wrong and redundant and prefer factories. But still, SOLID principles are the basic pillars of object oriented programming.
But what are they?
Webpack simplifies web development by solving a fundamental problem: bundling. It takes in various assets, such as JavaScript, CSS, and HTML, and then transforms these assets into a format that’s convenient to consume through a browser. Doing this well takes away a significant amount of pain from web development.
It’s not the easiest tool to learn due to its configuration-driven approach, but it’s incredibly powerful. The purpose of this guide is to help you get started with webpack and then to go beyond the basics.
The parts of a web user interface building blocks for both simple websites and modern front-end applications.
One of the most important aspects of writing maintainable code is being able to notice the repeating themes in that code and optimize them. This is an area where knowledge of design patterns can prove invaluable.
I take a look at a number of popular JavaScript design patterns and explore why certain patterns may be suitable for your projects.
The top 10 mistakes when beginners start to develop on AngularJS.
Many of us are using promises without really understanding them.
RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments