Rewrite in angular