Posts tagged "angularjs"

Found 11 posts tagged angularjs
Angular is a JavaScript framework for creating modern web applications, which are inherently declarative, modular, with testability in mind.
As you may be accustomed by now, in the JavaScript scene there is almost never a single way to program. I think it`s very difficult to find an idiomatic styleguide for the language/framework. What I found is that lots of intelligent people were talking about idiomatic solutions they found to write maintainable AngularJS applications, and some similarities caught my attention. One of them was the preference to use the controller as syntax, I definitely do too, and here is why.
> Angular`s digest loop is like a baby: you need to take care of it and feed it well, or it will puke all over your nice shirt. > Actually, it will probably, eventually do it anyway.


First of all I would like to explain why:

In my opinion sometimes you can write some of your E2E tests and your User-acceptance tests in one go, together.
I’m not saying all of them, some E2E tests can cover exceptional cases and often are on the sad path in terms of UAT.

Both of them are rather flaky in terms of feedback and can’t give any detailed hint where the test failed, except the approximate region of your application.

Both hit the application in the running state, so why not write some of them in the language of the business while testing technical aspects hidden behind?

It’s just a thought, probably I’m totally wrong and should read more about both aspects :)


Let's say you have an array of things. You want to provide to your user the ability to select two things from this array. If you use the <select> tag you won't be able to select multiple options from this list unfortunately. You can either come up with a new directive that handles this, use somebody else's plugin, or roll your own Angular filter (probably for learning purposes).
Angular's DI in combination with lazy loading of dependencies is one of my favourite features of Angular. I was fascinated about the simplified API that Angular provides to make DI happen and the ability to create testable, modular code out of the box. Anyways we are here to look what's behind Angular's DI, so here we go.