## Which UI-Router version should I install?

I don’t know why, but UI-Router doesn’t seem to be very clear about their versions, maybe they are ashamed of the old ones. However, this is really confusing and might lead you to install the wrong one. Their links just redirect me in a circle without providing me with any real idea what to install. […]

## 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, […]

## Mathjax Parser for HTML Strings

Mathjax is great for rendering math on the web. You can simply choose delimiters for inline- and display-math and then start inputing some html mixed with mathjax-delimited stuff, and mathjax will render it for you. For example: <p>Here’s some math: $\frac a b = c$</p> (assuming $…$ is your inline-math-delimiter) This could be great, for […]

## I can’t see my <hr> tag (horizontal line), where did it go?

If you can’t see your <hr> tag, your best bet might be that it somehow got display: flex . This will cause the hr to have width 0. Test it by giving it the style <hr style=”width: 100%”> and see whether this solves your problem. For example, if you use an Angular Material Design Card md-card, they […]

## Vertically AND Horizontally align div in div

Best way, even works for overflows. HTML: <div class=”body”> <div class=”content”> Bla Bla </div> </div> CSS: .body { display: flex; } .content { margin: auto; } Aaaand it works. Fiddle: https://jsfiddle.net/oqq4Lgo9/

## 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 […]

## Angular 1 (ng1) vs Angular 2 (ng2) Two-Way Data-Binding for (nested) Components in 2017

Update: An article focusing more strongly on Angular 2 can be found here https://www.bersling.com/2017/05/24/communication-between-components-in-angular-2/. It also elaborates the observables concept in more detail. Two-Way Data-Binding has long been one of the unique selling points of Angular 1 (ng1 in the following), until people started to complain that it slows down the apps too much. This was one […]

## Migrating an Angular 1 app to Typescript with Modules

Migrating an Angular App to Typescript with optional ES6 Modules I know, I know, Angular is pretty outdated, but some of us have apps in production running on Angular and would like to introduce typescript anyways… This being said, working with an Angular 1 app with typescript you’re in a really weird place right now. Half of the time when […]

## ES6 Modules and Typescript

The whole thing is still pretty crazy as of August 2016. If you want to develop your frontend with typescript, you’ll probably encounter all of those “things”: bower, npm, node, grunt, gulp, typescript, tsconfig, tsc, transpile, es6, javascript2015, module, module loader, import, export, require, systemjs, amd, umd, commonjs, babel, traceur, browserify, webpack… Those are just […]

## 5 Ways to Make a Div Fill Up the Remaining Width

How can you expand a div to take the remaining width? There are multiple ways: You can do it with Tables (okay, that’s not actually a div, but you could do it with div’s by setting the containers property to table-cell and the inner property to table-row or something like that), you could do it with margins, […]