Material Design Notifications for Angular2+

Astonishingly, I haven’t found a good reliable library to display material-design style notifications in Angular2. So I have created this library, it can be found here: It’s super easy to use, yet flexible. Material design is optional. The Material Design library is not required for this library to work! You can edit styles like box-shadow, position, background […]

Pitfalls in Angular 2+

Angular 1 has been complex, intertwined and error prone. “Is what I’m doing updating my data?”, “Why doesn’t this work?”, “WTF is this?” or “GNARRRFL I wrote myObject instead of my-object again!!” might have been common things you have said developing an angular 1 app. So what about Angular 2? Is it all chocolate and […]

State Management: ngrx/store vs Angular services

State management is one of the most difficult tasks in front-end development. In Angular2 we are presented with a number of options. The most promising ones seem to be holding reusable state in services vs. using the ngrx/store library specifically designed to help with state management. Here are my current views on the pros and […]

Managing State in Angular 2+

This problem has always been strongly discussed in the Angular community, but not many standards have emerged. Most tutorials are too far from real-world applications to capture the essence of the problem and only simplistic “parent-child” interactions are discussed. As an application grows, components become more deeply nested and we need solutions to handle interactions between components that are […]

Typescript Mongo Express Angular.io Node (MEAN) Boilerplate

UPDATE: A cool starter kit has developed out of my initial Typescript MEAN seed / boilerplate! It currently uses Angular4 and is from mid 2017. Check it out!   I was a bit shocked when I searched for Typescript MEAN (Mongo-Express-Angular-Node) tutorials and boilerplate code (with Angular.io I mean Angular2 or above). There is some material, but it’s […]

Don’t use UI-Router’s resolve

Let’s say you have an app with certain permissions. And let’s say the permissions can usually be determined by the URL. For example, when each URL encodes a resource and you’ll get from the server which permissions the current user has for this resource. Isn’t it then a great idea to use resolve in UI-router, […]

UIB (Bootstrap) Component Modals Made Easy

So UIB decided to support “component modals”. Unfortunately, the way I see it, the components need to be “dirtied” with the modal logic, meaning you will also need to include resolve and close in every component you want to display as a modal. Inside the components constructor or $onInit you then proceed to “resolve the resolve” (i.e. if(resolve){ […]

Wait for the Bindings of a Directive in Angular

If you’ve worked with angular for a while, you’ve probably found yourself having a directive like <my-directive my-prop=”myProp”></my-directive> where not having myProp ready yet (e.g. it’s retrieved from the server asynchronously) lead to problems. For example if the first thing you do in your directive is to call myProp.sayHello(), your app will crash saying cannot read property […]

Download File From Controller in Angular

Ever had to download a file from your controller in angular? Then you know the struggle is real. You’ll encounter iframe tricks and filesaver.js and all sorts of stuff. But instead of an iframe trick, what you should really do is a link (<a href=”url”></a>) trick!!! var a = document.createElement(‘a’); a.href = yoururl; a.target = […]