Posts

[$injector:nomod] Module is not available! running karma unit tests

Recently ran into this error in AngularJS regarding module missing when running my Jasmine tests "[$injector:nomod] Module '' is not available!  You either misspelled the module name or forgot to load it.  If registering a module ensure that you specify the dependencies   as the second argument" Turned out that I needed to add the module definition file first before loading the other services that use that module. karma.conf.js extract files: [ 'src/app/module.js', 'src/app/usingModuleAbove.js' ] Other solutions for this issue can be found in John Papas post here  

Javascript, are variables copy by value or by reference

Just a small post to help me remember if Javascript objects are either copy by value or by reference... Copy by Value String Number  Boolean Copy by Reference: Array Object Function

Eclipse Error: “Enabling Maven Dependency Management” has encountered a problem

Eclipse and Maven interaction can be a bit of a pain at times, but now since upgrading to the latest version of Eclipse (Kepler) whenI import my Maven projects the folders are all marked with the red x error indicator icon and multiple popups display with the following error message: Eclipse Error: “Enabling Maven Dependency Management” has encountered a problem To resolve this I had run the following steps: 1. Disable Maven nature from each of the projects 2. Run a the following maven command on the project: mvn eclipse:clean 3. Right click on the project and do the following Configure > Convert to Maven Project... Environment Windows 7 64-bit Eclipse Kepler 64-bit Maven 3.1.1 Java 64-bit 1.7.0_51

Spring Webflow - External Redirect on an end state in a subflow, NoMatchingTransitionException

When using a end-state in a Subflow you may encounter the following exception: NoMatchingTransitionException: No transition found on occurence of event Subflow Note that in a subflow the view attribute of the end-state is ignored, so this redirect needs to be defined in the parent flow. Parent Flow     Updated Subflow

Linking an Icon to an executable in Ubuntu

To link an icon to an executable in Ubuntu you need to do the following: (In my example I will be using Aptana Studio) 1. Open a terminal window and go to  /usr/share/applications 2. Create a desktop file by running sudo gedit app-name.desktop (aptana.desktop) 3. Add the following properties to the .desktop file [Desktop Entry] Type=Application Encoding=UTF-8 Name=Eclipse Comment=Aptana Studio IDE Exec=/opt/Aptana_Studio_3/AptanaStudio3 (your executable) Icon=/opt/Aptana_Studio_3/icon.xpm (your icon) Terminal=false Type=Application Categories=GNOME;Application;Development; StartupNotify=true Save the File If you now search for your application the icon should be linked to the executable. Update: In order to get the icon appearing in the launcher bar, I had to copy the aptana.desktop file into ~/.local/share/applications/ I then pressed the windows key and searched for 'aptana' and dragged the icon to the launcher bar.

Spring Webflow: Unit testing with Parent flows

Recently I had to test a webflow that extended a parent webflow. The documentation didn't offer much in the way of help but did suggest that you use getModelResources() method to register additional flows from the AbstractXmlFlowExecutionTests class @Override protected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory) { FlowDefinitionResource[] flowDefinitionResources = new FlowDefinitionResource[1]; flowDefinitionResources[0] = resourceFactory.createFileResource("src/main/webapp/WEB-INF/flows/base-flow.xml"); return flowDefinitionResources; } Great! Or so I thought... Below is how I extended the flow to use the base parent flow. I registered the base-flow.xml in the flowRegistry like below and I assumed that the AbstractXmlFlowExecutionTests class would register the flow as id="base" ... This was the wrong assumption, after debugging I no...

IE8, Javascript Errors and console.log

Ran into an issue with IE8 and using the JQuery validation framework. Basically what was happening was that the validation framework was kicking in and identifying the errors (correct) but the form was still getting submitted to the server. (Incorrect!) Anyway after some investigation I found that it was the  console.log statements in the javascript code that was causing the issues. As I was using the developer toolbar provided with IE I wasn't seeing the issue this is because the console object gets created when you open the developer toolbar duh! So if you are getting some weird behaviour check that you don't have any console statements in you Javascript files.