Javascript Tag

Click here for TL;DR As I am learning some of the new features of ES6 it has gotten me thinking about how we are currently using them is ES5. Specifically Promises. Using Promises in ES5 has been made possible by several libraries out there. Most known would be the q library by Kris Kowal. Because of my love for, and general focus on, Angular I want to talk a little about the $q Service and using Promises in AngularJS.

Using Promises in AngularJS

It is important to note that Angular's $q Service does not actually contain Kris Kowal's q library. However like Kris's library it allows us to write Promises in ES5. I have seen Promises used in Angular many different ways. I wanted to touch upon how I use them and why. What is a Promise Many would think of a Promise as replacement for callback functions. While this is true to some extent I think this is an unfair over simplification of the power Promises really give to JavaScript developers.

No TL;DR Required :)

const Declarations

So the next easy introduction to some ES6 properties are const declarations. const declarations are equivalent to var DONTCHANGEME = "foo" in ES5. When I say equivalent I mean in idea not behavior. The var syntax and variables created with var can be assigned and re-assigned at any time. In ES6 the "read-only" nature of const declarations is respected and enforced

No TL;DR Required :) I recently got back from attending AngularU in San Francisco. One of the best parts about going to community conferences like this is getting fired up about programming. There was a lot of information that I soaked up while in SF. It also became very clear that there is a lot that I need to learn if I want to keep up with the front end development community. One of those things is Ecma Script 6, ES6, or ES 2015 (it's being called a lot of things). So I decided to write blog articles as I start learning different pieces of ES6. This is the first in a series and will be about let declarations.

Click Here for TL;DR

Understanding Bower

Modularity in code is great for a number of reasons:
  1. less work (someone else did it for you)
  2. tested for more use cases than you can think of on your own (might not seem important until your user base goes up)
  3. update easily
  4. reasons
Humans and computers are good at different tasks. So while you as a human will still need to hunt down _which_ module will work best, there are machine tools to do the well-defined, rote work of getting modules into your project. Enter bower.

Click Here for TL;DR Click here to see completed ng-famous boilerplate. and AngularJS

Today we will be Creating Beautiful Animations with Using ng-repeat. Yeah, the title doesn't exactly roll off the tongue. If you are a Javascript fanboy, there is a good chance that you have heard of and (can we just call this ng-famous for now on!? Yeah, I'm going to do that..). If you haven't, prepared to be learned. Here is the elevator pitch: is a free, open source JavaScript framework that helps you create smooth, complex UIs for any screen.
What does this mean? It means is a front-end rendering library that allows you to create animated UI's that are both beautiful and wicked fast (like 60 fps fast) that can move on all 3 axis! And if there is latency it handles it well, and interpolates instead of lags behind. So now that we have for rendering our front-end, we still need a modular architecture for our code and maybe a solution that's a little less opaque to the feign of heart.

Click Here for TL;DR Like most frameworks out there Angular has certain methods/procedures for getting your application ready for production. Some of those methods include Strict Dependency Injection Mode, Disabling Debug Data, and more. On this post we will focus on Disabling Debug Data.

Disabling Debug Data

"By default AngularJS attaches information about scopes to DOM nodes, and adds CSS classes to data-bound elements."
You may noticed while viewing the source of your web app built with Angular that many of your DOM elements have the class ng-scope added to them. This is something Angular does when the compiler creates a new scope by either ngBind or double mustache interpolation {{.....}} Below is an example of a portion of the DOM tree from an angular application.

Click Here for TL;DR Part 2 of this series were going to talk about nested states. Specifically states nested deeper than two levels. UI Router Ionic uses Ui Router to handle all of it's routing and state change.  Ionic uses many  directive throughout it's framework to add functionality or mimic functionality of angular directives.  Ionic uses ion-nav-view to replace UI Routers ui-view and add additional functionality. From their site:
The ion-nav-view is our container. Ionic’s router will look for this directive throughout our code to insert templates. ion-nav-view supports inheritance, named views, and other features that we will discuss in depth throughout this series. Note: If you’re familiar with angular-ui-router, ion-nav-view is equivalent to ui-view. On top of that, ion-nav-view provides for animations, history, and more.

Click Here for TL;DR I am just about finished building my first *complete* mobile application with the Ionic Framework.  There were several things I got hung up on and found useful solutions too after doing some research.  Some of the answers were on the Ionic website while some were buried on the web.  The first post will be in regards to geolocation.


Lazy Loading in Angular and Integrating AMDs

Click Here for TL;DR Angular's Dependency Injection Dependency injection (DI) as defined by Angular... DI in Angular allows you to use modules, services, controllers, directives, and filters that can depend on one another to operate. By $injecting these dependencies into each other they can reference each others public APIs and operate accordingly.  This concept of DI loads all files upfront so that they are available for use whenever necessary (which may be never for certain use cases). Require JS From RequireJS site: "RequireJS is a JavaScript file and module loader. " RequireJS has two main functionalities.