AngularJS rewrite.