Skip to main content

Posts

Showing posts from August, 2013

Using Angular.js Factories to Get Remote Data

In this post, I’d like to show the differences between using an Angular.js factory to get local JSON data vs remote data via an AJAX call. For this example, I’m assuming that we have a JSON dataset that describes different types of fruit, for example: { "fruits": [ { "id": "1", "name": "Apple" }, { "id": "2", "name": "Orange" } ] } At it’s simplest, an Angular.js view to iterate over this data could look like the following HTML: <!doctype html> <html lang="en" ng-app="fruitsApp"> <head> <title>Angular Sample App</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script src="app.js"></script> </head> <body> <div ng-controller="fruitsController"> <ul> ...

Octopress Flattr Module

I’ve just created an Octopress aside that will allow you to easily add a Flattr badge into your Octopress blog. Installation of the aside is very straightforward. Copy the files from the Github project into your local Octopress blog directory. Edit the _config.yml file and add a flattr_user setting for your Flattr user name, e.g. flattr_user=me Add the custom/asides/flattr.html aside into your default_asides Rebuild your Octopress blog For example: default_asides: [..., custom/asides/flattr.html, ...] flattr_user: me The code for the plugin is available on Github .  If you’ve any problems with the module, create an issue on Github and I’ll take a look :)

Apache Tomcat takes a step closer to Java EE 7

The Apache Tomcat team have announced the availability of Tomcat 8.0.0-RC1.  Tomcat 8 is expected to support Java EE 7, with this new release adding support for Servlet 3.1, JSP 2.3, EL 3.0 and WebSocket 1.0 In the release notes, the team states the purpose of this release candidate is: "to give users an opportunity to test Tomcat 8 and provide feedback to the Tomcat community. It has been given an alpha status which means that it is not judged as being ready for production usage. The implementations of the 4 Java EE 7 specifications are all complete but there is some internal refactoring to be completed before the alpha label is removed." As usual, release notes are available.  The software can be downloaded from the project site . Hopefully with Tomcat 8 being released, this will pave the way for Apache TomEE to be fully Java EE 7 compliant. Have you used Tomcat 8 or are you going to wait until its released as RC to use it?  Leave your comments below.

JavaScript Patterns

I’m currently reading “ Learning JavaScript Design Patterns ” by Addy Osmani. According to the book, it’s targeted at: professional developers wishing to improve their knowledge of design patterns and how they can be applied to the JavaScript programming language. It’s a really good resource for those wanting to improve the quality of their JavaScript, and I’d recommend JavaScript developers of all levels to take a look.