Home » JavaScript » Angular.js » Page 19

Angular.js

Learning Angular: Access directive scope variables from directive controllers and vice versa

Angular directives can have a separate, isolated scope, which is even the suggested approach most of the time. And they can have directive controllers. But…how do I access the directive’s scope variables from the directive controller and vice-versa?? It’s quite simple, read on and see it yourself. This article is part of my “Learning NG” series, presenting some of my ...

Read More »

Interception using Decorator and Lazy Loading with AngularJS

Angular provides it’s own dependency injection that supports everything from annotations to decorators. Interception is a feature that allows you to extend, intercept, or otherwise manipulate existing services. It makes it easy to monkey-patch existing APIs to suite the specific needs of your application. You can build an app that relies on the built-in services for common functionality such as ...

Read More »

Revisiting AngularJS with TypeScript

Many of my recent blog posts and presentations have focused on pure JavaScript. I believe TypeScript is an incredibly useful tool, especially when developing heavy client apps with large teams. I don’t use it in most examples so they stay relevant to developers who haven’t adopted it. TypeScript is a strong asset for AngularJS apps. I was recently asked about ...

Read More »

Learning Angular: Useful utility functions

Today a very short post. Angular has a series of utility functions which you should definitely take a look at. They are not as feature rich as those of underscore.js or lodash.js but might be more than enough for your needs. This article is part of my “Learning NG” series, presenting some of my adventures while learning Angular. Check out ...

Read More »

AngularJS UI-Router – Components

This is the second post of a series of 3, presenting AngularJS UI-Router library: Part 1: Introduction Part 2: Components AngularJS UI-Router – Example         Components As stated in the introduction to this routing library, the AngularJS UI-Router is built around states which allow us to have states bound to URLs like ngRoute module, but also leave us ...

Read More »

Using AngularJS to Extend Your Code Quality

The AngularJS API provides a function named extend that can help improve your code quality and efficiency. I always look for ways to improve quality, increase efficiency, reduce risk and eliminate ritual and ceremony when I am developing software. Perhaps the simplest way to express this is the DRY principle (Don’t Repeat Yourself). I prefer a refactoring-driven approach to this ...

Read More »

AngularJS Tip: Using a Filter with ngClass

I was working on my presentation of building an AngularJS app for the upcoming Atlanta Code Camp and ran into an interesting scenario. The app tracks various variables and formulas and then displays them in a responsive fashion. I’ll post the deck and code after the camp. One formula is Body Mass Index, an indication of general weight and health. ...

Read More »

Learning Angular: Unit Testing watch expressions

Today I wanted to write a unit test for a watch expression on my controller. What seemed quite obvious initially, turned out to be quite nasty. Anyway, thx to a nice community member on the Angular IRC, I was able to quickly resolve the issue. So, here’s the story.   This article is part of my “Learning NG” series, presenting ...

Read More »

Part Deux: A Google Calendar Gadget in Angular.js

I was on a project recently where the team was faced with a daunting list of scheduling-related backlog stories. When looking at the entire feature, about 20% of these stories dealt with custom functionality and 80% of them dealt with issues that are common to any scheduling or calendar application: start times, end times, visibility/privacy, conflicts, notifications, etc etc. When I asked ...

Read More »