Posts

Angular Testing child component inputs

Testing child component inputs When testing Angular components we sometimes run into the situation where we need to test a child components inputs in order for us to verify that the expected input parameters have been passed to the child component. So in the example below, we want to verify that the child component param1 has been passed in the correct property. <app-parent>     <app-child [param1]="name"></app-child> <app-parent> How do we test this? So we could create a test module, test component and register it with the TestBed but there's an easier way (I'll create a follow-up post on how to do this also). Enter ngMocks ngMocks is a library for testing Angular Component dependencies. More information can be found here on it  https://github.com/ike18t/ng-mocks How do we use it? Firstly we need to import the library into our Jasmine test file. import { MockComponent } from 'ng-mocks'; Then we need to

Grails 3.2: Bootstrap.groovy is not executed when run as an executable war/jar file

Ran into an issue yesterday when running my grails application as an executable jar file via the command below in that it wouldn't execute the Bootstrap.groovy file. Here I had some domain objects that were used to populate the database with static data. >java -Dgrails.env=prod -jar build/libs/my-app.war The issue turned out to be that the Bootstrap.groovy file was not under a package name, it was sitting under grails-app         init              BootStrap.groovy This had to changed to be under a package name grails-app         init              myapp                  BootStrap.groovy After this change the BootStrap.groovy file was executed on startup

Setting up Swannview Home Security CCTV with Eircom F1000 router

Image
Setting up CCTV with Eircom EFiber F1000 router To setup the Swannview CCTV with remote access on the Eircom F1000 router I added the following settings into the router under Network Settings > NAT > Port Forwarding NOTE: Ensure the QoS under Network Settings > QoS is DISABLED

[$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