AngularJS Directives Naming

Having a clear naming plan for you code is always considered a best practice. Especially if you work on languages like Javascript where it’s so easy to make a mistake on the name of an object property and no one will complain until you start debugging your application and spend hours because of a small naming mistake.

Libraries and frameworks like Angular.js will make things easier for you and provide you with a clear way to design your code but you have to respect its rules. Naming element directives properly is one of the very important rules.

Continue reading

AngularJS Modules

The module concept in Angular.js is something that you love when you’re one of these developers who don’t like having global variables in your application. I’m one of these guys. It works by letting you define angular modules and then you can include objects in these modules based on what their functionality is. For example you might want to have a module for all your network services, another for your directives, another for your controllers and so on. Defining these modules and accessing them later from some other part of your code might be a bit confusing because the syntax differences are minor. This tip is all about these two functions in Angular.

Continue reading

Android Layer-List

When you’re working with graphic assets in Android, it’s nearly impossible to avoid importing bitmap files in your project. And that’s ok because for a complicated design (with many shadows and textures for instance) it’s the right solution. Trying to make these graphics work with multiple screens though will eventually get ugly because you’ll have to use 3 or 4 versions for each bitmap. It makes sense then to use any non-bitmap solution where you can. Android’s layer-list is one of these powerful solutions.

Continue reading

Android Web Images

The visual components, or widgets as they are called inside the Android SDK are usually easy to work with once you understand how they should be positioned and how to access their data. I recently I found myself working with one of these components, the ImageView, and not being able to set it’s image to load from a url. I thought that something so common could be done easily but it looks like you can’t do it with the default ImageView. You can however make your own ImageView with 60 lines of code!

Continue reading