Why should you use angular-cli?

A project should have a bundler, regardless of the technology stack. A bundler is software that bundles your application code along with its resources into a minimized, zipped bundle that can be easily deployed on the server (at its most basic form).

There are many bundlers out there, most widely used are Grunt, Gulp and lately, Webpack. They each take a different approach to fulfill the task at hand – but Webpack really stands out from the crowd.

Continue reading

Jasmine describe override

Say you want to test your Angular application.

To do that you’ll be implementing Unit tests (with the Jasmine + Karma + PhantomJS stack) or E2E tests (with the Jasmine + Protractor stack).
You could choose any other stack using Cucumber, mocha, chai or any other testing framework – the principle of today’s topic remains the same.

The scenario is this:
There’s this piece of setup code that needs to be executed before each spec in every suite (performing login, for example).
I chose before each spec for the sake of the argument, but the same concept could be applied to before all specs in the suite and/or after each and after all specs in the suite.

for the sake of the post: describe = suite and it = spec.

Continue reading

CSS Themes as white label

Recently, I had to add white-label support for the project.

This means, that some elements on screen had to be able to get theme-specific styling. Usually this mainly means theme-specific colors, but this can easily be extended to SVGs, graphics, Logos etc.

So, I came up with a neat CSS trick I’ll go over today.

Continue reading

TickerSrv – Timing service revamped

Mid 2014, I published a post about a timing service. You can read the post here.

Recently, I wanted to use this service for a client but the requirements meant that I had to refactor the code to be more robust.

Continue reading

Jasmine tests – setup describe

When I published the post about the Local Storage Cache Service, I also published the service code and test on GitHub.

This raised quite a few questions from readers in regards to the test. Specifically, why I implemented it with a main describe that contained an inner setup describe and an inner tests describe.

Continue reading

ES6 Fiddle

We’ve all used an online JS sandbox to fiddle or try some code real quick. There are a few alternatives out there, the most notable are JSFiddle and Plunker. Personally, I prefer Plunker as it also supports Github integration and for me it’s easier to add external resources.

Well, the ES6 draft was proposed to W3C, which means it might be closed and released later this year and if you’re anything like me, you can’t wait to get your hands dirty and try out the new stuff that’s coming our way.

Continue reading

Your very own Font Awesome font

Ever since Font Awesome came out, I was amazed at how simple it made things.
It really is… well… Awesome!

Working with graphics or icons was never a major hassle but using icons as a font has so much more going for it!

Continue reading

Linking 2 local projects, without the Ugh factor

When working on a large scale application, eventually you’ll want to break it down to one or more product sub projects that all depend on a common project.

This post will discuss how to work with 2 projects properly while still using bower to manage dependencies

Continue reading

Free from include!

If you ever took part in any serious JS development in general and AngularJS specifically, you know that every time you create a new js file, you need to manually include a reference to it in the index.html file, other wise it won’t be included and the app will fail.

How would you feel about not having to do that?

Continue reading