Improving the Yeoman Generator Gulp Angular

The Yeoman generator generator-gulp-angular is a great tool for building AngularJS and in my opinion is much better than the official Yeoman generator for AngularJS (generator-angular), because it uses Gulp and not Grunt as the task runner, it has a component-like folder structure for the code instead of the “drawer” style, it uses libsass instead of compass (ruby), it supports Typescript and has a lot of options for configuration.

But there is a thing that I don’t like: how it handles bootstrap-sass.

Continue reading “Improving the Yeoman Generator Gulp Angular”

Abstract/Concrete Inheritance Model in AngularJS

In a previous post I showed how to create a “classic” inheritance model in AngularJS using directives. This time I will show another inheritance model: the abstract/concrete.

In OOP, an abstract class cannot be instantiated, it serves only to provide common properties and functionality to child classes. In Angular, we have to make an analogy and define that an abstract directive is one that does not have a template or a link function, only a controller. The template is provided by child directives.

Continue reading “Abstract/Concrete Inheritance Model in AngularJS”

Directive Inheritance in AngularJS

Inheritance is a powerful way to extend directives functionality and at the same time, improve code reuse. Lets see how it works in Angular with a simple example. The first step is to create a directive called “outer” which is going to be our top-level directive in our hierarchy.

Continue reading “Directive Inheritance in AngularJS”