Posts about AngularJS

Configuring Karma for Bower Dependencies

October 15th 2016 AngularJS TypeScript Unit Testing

Although, I have now configured my Cordova project to automatically copy distribution files from installed Bower packages and reference them from HTML pages, there's still one final part of Bower-related configuration left: unit tests also require Bower dependencies. I don't want to manually update the configuration of my test runner every time I install an additional Bower package.

Distinguish Between Manual and Programmatic Map Movement in Leaflet

June 26th 2016 Leaflet AngularJS

Leaflet map state can be manipulated in two ways: manually using mouse to pan and zoom or programmatically with a set of methods for this specific purpose. In some cases it can be useful to know which of these two approaches was used for manipulating the map. Unfortunately Leaflet doesn't have a built-in way to distinguish between the two map manipulation modes, but with a good enough understanding of the JavaScript runtime this can still be achieved.

Handling Events with Angular Leaflet Directive

February 8th 2016 Leaflet AngularJS

Leaflet JavaScript library includes comprehensive support for events, raised by the map itself or by one of many objects rendered on the map. Detailed documentation covers all aspects of working with events: management of individual event listeners, structure of arguments passed to listener functions, and a list of supported events for the map and for each individual object type. Angular Leaflet directive broadcasts all these events as standard JS events, but the documentation is much more scarce.

Bringing a Marker to Front in Leaflet

January 23rd 2016 Leaflet AngularJS

Leaflet is an open-source JavaScript library for interactive maps. It's very feature rich, but its sometimes hard to find resources on approaches that deviate from the most common ones. When handling many markers in a small region, clustering is the go-to solution, but certain scenarios can require every markers to be rendered all the time. Leaflet has features to keep individual markers easily accessible nevertheless.

Unit Testing JSData Code in AngularJS Services

December 20th 2015 JSData AngularJS Unit Testing

JSData is a feature rich data modeling library for JavaScript with good support for AngularJS. Although the documentation isn't perfect, it's not too difficult to get started with the library. Testing the code which uses the library, is a different matter altogether. There is a mocking library available, but it literally has no documentation.