Random thoughts & observations

From the mundane to the profound and everything in between here’s what’s rocking our world

Resolving AngularJS executing controller twice issue

Posted: June 28, 2015
Written by: Saints At Play
Category: AngularJS

If you've been developing with AngularJS for some time then you may have unwittingly come across the following issue: your controller is executed twice.

Seems like one of those coding problems that shouldn't exist but fixing this is, thankfully, quite simple...

More »

Using Google Maps in Angular JS

Posted: March 10, 2015
Written by: Saints At Play
Category: AngularJS

Angular JS, once you switch from a jQuery mindset, makes building out web apps relatively quick and thanks to the growing number of available plug-ins you can be sure to find a solution to fit your development needs.

One such need might involve implementing Google Maps which is what we are going to look at through this tutorial.

More »

Parsing html data from an array inside an AngularJS view

Posted: February 16, 2015
Written by: Saints At Play
Category: AngularJS

There's no denying that AngularJS is a fantastic framework to develop with but if you're coming from a jQuery/traditional JavaScript background there are certain aspects of Angular based development you might initially struggle with.

One of those is parsing HTML strings within views using ng-repeat.

More »

Incrementing a loop inside an angularjs view

Posted: February 14, 2015
Written by: Saints At Play
Category: AngularJS

If you've been using AngularJS for some time you might find there are occasions where you want to display the incremented value of a loop counter inside a view instead of calculating/returning that from within the controller logic.

Doing this is incredibly easy...

More »

Resolving POST requests in AngularJS

Posted: November 1, 2014
Written by: Saints At Play
Category: AngularJS

There you are using AngularJS for posting form data to a remote server and you come across the most perplexing bug: despite the data being captured properly it just isn't posted. You double check both your Angular script and server side script but can't find the source of the issue - the code is bug free and should work but it isn't.

What to do?

More »

AngularJS errors with JSON parsing

Posted: March 16, 2014
Written by: Saints At Play
Category: AngularJS

If you've been developing with MVVM (Model View - View Model) framework AngularJS chances are you'll have encountered errors with parsing JSON from an AJAX call. Like any good web developer when you inspect the browser console for more information on the nature of the error you'll probably get something along these lines:

Error: JSON Parse error: unterminated string

As far as browsers reporting back JavaScript errors this is probably one of the most helpful as we know exactly what the source of the problem is and where to look (unlike some of the more cryptic errors messages that can sometimes be returned). 

More »

Latest Tweets