copied in code from angular seed