Angular Remove Query Params Javascript Foreach