Angular controller bootstrapping Add AngularJS controller dynamically


Let me show you how to add angular controller dynamically: after application has bootstrapped. It is useful for example when you are loading components dynamically.

Read more ...

ECMAScript 6 arrow function Arrow functions in ECMAScript 6


I think that an arrow functions are one of the best features of ECMAScript 6, excluding class-es and OOP programming at all.

It has really very helpful and useful syntax for scripting language. So let’s check it out:

Read more ...

three-state checkbox Creating AngularJS Directive 'Three-state-checkbox'

Pre-story

Yesterday at work, I’ve received a task, which I should had done today (and I actually did).
Simple task to filter table by logical value in one column.

So I had 3 values to filter by: null, true and false (not filtered, published, unpublished).
I’ve thought what would be the best visual solution for that… I knew, that I don’t want to create three-option select, like that: (what is actually the fastest solution of that issue) .

But I’ve decided to make three-state checkbox. I wanted it to be clean and semantic solution, so I’ve also decided to create open-source package with AngularJS directory of three-state-checkbox.

Read more ...

Scope Block-Scoped Functions in ECMAScript 6

Image above clearly shows how does scope is nesting in JavaScript.
In JavaScript ECMAScript 5 every scope it is a scope of function. Blocks, like if{}else{}, are not creating their own scope.

If you want to make your function block-scoped in ES5 you’ll have to nest it to another function.
But in ECMAScript 6 you have better solution!

Read more ...

ECMAScript 6 let LET in ECMAScript 6 - Block Scoped Variables

let has the same block scoping as const, but let us look over Block Scoped Variables in ECMAScript 6

Read more ...