move angular in index into the controller